diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Customization/Models/BotServicePrivateLinkResourceData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Customization/Models/BotServicePrivateLinkResourceData.cs new file mode 100644 index 000000000000..4dcf73812b8c --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Customization/Models/BotServicePrivateLinkResourceData.cs @@ -0,0 +1,25 @@ +// 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.Models; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class BotServicePrivateLinkResourceData + { + /// Initializes a new instance of . + public BotServicePrivateLinkResourceData() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// The private link resource Private link DNS zone name. + public IList RequiredZoneNames { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs index cfb71b347d72..b41e5fee87df 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs @@ -7,15 +7,27 @@ using System; using System.Collections.Generic; +using System.ComponentModel; 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 . + /// 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); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -81,12 +93,13 @@ public static BotData BotData(ResourceIdentifier id = null, string name = null, /// 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, 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, IEnumerable networkSecurityPerimeterConfigurations = null, string openWithHint = null, string appPasswordHint = null, string provisioningState = null, string publishingCredentials = null) { allSettings ??= new Dictionary(); parameters ??= new Dictionary(); @@ -94,6 +107,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, @@ -127,6 +141,7 @@ public static BotProperties BotProperties(string displayName = null, string desc schemaTransformationVersion, storageResourceId, privateEndpointConnections?.ToList(), + networkSecurityPerimeterConfigurations?.ToList(), openWithHint, appPasswordHint, provisioningState, @@ -160,6 +175,152 @@ public static BotServicePrivateEndpointConnectionData BotServicePrivateEndpointC serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// 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) + { + return new NetworkSecurityPerimeterConfigurationData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: 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) + { + provisioningIssues ??= new List(); + + return new NetworkSecurityPerimeterConfigurationProperties( + provisioningState, + provisioningIssues?.ToList(), + networkSecurityPerimeter, + resourceAssociation, + profile, + serializedAdditionalRawData: 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) + { + return new ProvisioningIssue(name, properties, serializedAdditionalRawData: 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, Severity? severity = null, string description = null, IEnumerable suggestedResourceIds = null, IEnumerable suggestedAccessRules = null) + { + suggestedResourceIds ??= new List(); + suggestedAccessRules ??= new List(); + + return new ProvisioningIssueProperties( + issueType, + severity, + description, + suggestedResourceIds?.ToList(), + suggestedAccessRules?.ToList(), + serializedAdditionalRawData: 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 NspAccessRule(name, properties, serializedAdditionalRawData: 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) + { + addressPrefixes ??= new List(); + subscriptions ??= new List(); + networkSecurityPerimeters ??= new List(); + fullyQualifiedDomainNames ??= new List(); + emailAddresses ??= new List(); + phoneNumbers ??= new List(); + + return new NspAccessRuleProperties( + direction, + addressPrefixes?.ToList(), + subscriptions?.ToList(), + networkSecurityPerimeters?.ToList(), + fullyQualifiedDomainNames?.ToList(), + emailAddresses?.ToList(), + phoneNumbers?.ToList(), + serializedAdditionalRawData: 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, AzureLocation? location = null) + { + return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData: 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 ResourceAssociation(name, accessMode, serializedAdditionalRawData: 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) + { + accessRules ??= new List(); + enabledLogCategories ??= new List(); + + return new Profile( + name, + accessRulesVersion, + accessRules?.ToList(), + diagnosticSettingsVersion, + enabledLogCategories?.ToList(), + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The sku name. /// Gets the sku tier. This is based on the SKU name. @@ -169,6 +330,93 @@ public static BotServiceSku BotServiceSku(BotServiceSkuName name = default, BotS 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) + { + return new BotServiceHostSettingsResult( + oAuthUri, + toBotFromChannelOpenIdMetadataUri, + toBotFromChannelTokenIssuer, + toBotFromEmulatorOpenIdMetadataUri, + toChannelFromBotLoginUri, + toChannelFromBotOAuthScope, + validateAuthority, + botOpenIdMetadata, + 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) + { + return new BotServiceProvider(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) + { + parameters ??= new List(); + + return new BotServiceProviderProperties( + 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 BotServiceProviderParameter BotServiceProviderParameter(string name = null, string serviceProviderParameterType = null, string displayName = null, string description = null, Uri helpUri = null, string @default = null, bool? isRequired = null) + { + return new BotServiceProviderParameter( + name, + serviceProviderParameterType, + displayName, + description, + helpUri, + @default, + isRequired != null ? new ServiceProviderParameterMetadata(new ServiceProviderParameterMetadataConstraints(isRequired, 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 GetBotServiceQnAMakerEndpointKeyResult GetBotServiceQnAMakerEndpointKeyResult(string primaryEndpointKey = null, string secondaryEndpointKey = null, string installedVersion = null, string lastStableVersion = null) + { + return new GetBotServiceQnAMakerEndpointKeyResult(primaryEndpointKey, secondaryEndpointKey, installedVersion, lastStableVersion, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -316,89 +564,6 @@ public static BotChannelSite BotChannelSite(Guid? tenantId = null, string siteId 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) - { - return new BotCreateEmailSignInUriResult(id, location, createEmailSignInUrlResponseUri != null ? new CreateEmailSignInUrlResponseProperties(createEmailSignInUrlResponseUri, serializedAdditionalRawData: null) : null, 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 BotServiceNameAvailabilityResult BotServiceNameAvailabilityResult(bool? isValid = null, string message = null, string absCode = null) - { - return new BotServiceNameAvailabilityResult(isValid, message, absCode, 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) - { - return new BotServiceProvider(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) - { - parameters ??= new List(); - - return new BotServiceProviderProperties( - 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 BotServiceProviderParameter BotServiceProviderParameter(string name = null, string serviceProviderParameterType = null, string displayName = null, string description = null, Uri helpUri = null, string @default = null, bool? isRequired = null) - { - return new BotServiceProviderParameter( - name, - serviceProviderParameterType, - displayName, - description, - helpUri, - @default, - isRequired != null ? new ServiceProviderParameterMetadata(new ServiceProviderParameterMetadataConstraints(isRequired, 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 GetBotServiceQnAMakerEndpointKeyResult GetBotServiceQnAMakerEndpointKeyResult(string primaryEndpointKey = null, string secondaryEndpointKey = null, string installedVersion = null, string lastStableVersion = null) - { - return new GetBotServiceQnAMakerEndpointKeyResult(primaryEndpointKey, secondaryEndpointKey, installedVersion, lastStableVersion, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -433,6 +598,8 @@ public static BotConnectionSettingData BotConnectionSettingData(ResourceIdentifi } /// 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. @@ -442,11 +609,13 @@ public static BotConnectionSettingData BotConnectionSettingData(ResourceIdentifi /// 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) + public static BotConnectionSettingProperties BotConnectionSettingProperties(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 BotConnectionSettingProperties( + id, + name, clientId, settingId, clientSecret, @@ -458,28 +627,14 @@ public static BotConnectionSettingProperties BotConnectionSettingProperties(stri 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 BotCreateEmailSignInUriResult BotCreateEmailSignInUriResult(ResourceIdentifier id = null, AzureLocation? location = null, Uri createEmailSignInUrlResponseUri = null) { - return new BotServiceHostSettingsResult( - oAuthUri, - toBotFromChannelOpenIdMetadataUri, - toBotFromChannelTokenIssuer, - toBotFromEmulatorOpenIdMetadataUri, - toChannelFromBotLoginUri, - toChannelFromBotOAuthScope, - validateAuthority, - botOpenIdMetadata, - serializedAdditionalRawData: null); + return new BotCreateEmailSignInUriResult(id, location, createEmailSignInUrlResponseUri != null ? new CreateEmailSignInUrlResponseProperties(createEmailSignInUrlResponseUri, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -507,6 +662,16 @@ public static BotServicePrivateLinkResourceData BotServicePrivateLinkResourceDat serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Entity Tag of the resource. + /// 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) + { + return new AcsChatChannel("AcsChatChannel", etag, provisioningState, location, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Entity Tag of the resource. /// Provisioning state of the resource. @@ -535,6 +700,105 @@ public static AlexaChannelProperties AlexaChannelProperties(string alexaSkillId return new AlexaChannelProperties(alexaSkillId, uriFragment, serviceEndpointUri, isEnabled, 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) + { + return new DirectLineChannel( + "DirectLineChannel", + etag, + provisioningState, + location, + serializedAdditionalRawData: null, + properties); + } + + /// 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 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) + { + trustedOrigins ??= new List(); + + return new DirectLineSite( + 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 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) + { + return new DirectLineSpeechChannel( + "DirectLineSpeechChannel", + etag, + provisioningState, + location, + serializedAdditionalRawData: null, + properties); + } + + /// 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 email channel resource. + /// A new instance for mocking. + public static EmailChannel EmailChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, EmailChannelProperties properties = null) + { + return new EmailChannel( + "EmailChannel", + etag, + provisioningState, + location, + serializedAdditionalRawData: null, + properties); + } + /// Initializes a new instance of . /// Entity Tag of the resource. /// Provisioning state of the resource. @@ -574,16 +838,16 @@ public static FacebookChannelProperties FacebookChannelProperties(string verifyT serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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 email channel resource. - /// A new instance for mocking. - public static EmailChannel EmailChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, EmailChannelProperties properties = null) + /// 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) { - return new EmailChannel( - "EmailChannel", + return new KikChannel( + "KikChannel", etag, provisioningState, location, @@ -591,14 +855,53 @@ public static EmailChannel EmailChannel(ETag? etag = null, string provisioningSt properties); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Entity Tag of the resource. /// 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) + /// 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) { - return new OutlookChannel("OutlookChannel", etag, provisioningState, location, serializedAdditionalRawData: null); + return new LineChannel( + "LineChannel", + etag, + provisioningState, + location, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// The list of line channel registrations. + /// 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) + { + lineRegistrations ??= new List(); + + return new LineChannelProperties(lineRegistrations?.ToList(), callbackUri, isValidated, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Id generated for the line channel registration. + /// Secret for the line channel registration. + /// Access token for the line channel registration. + /// A new instance for mocking. + public static LineRegistration LineRegistration(string generatedId = null, string channelSecret = null, string channelAccessToken = null) + { + return new LineRegistration(generatedId, channelSecret, channelAccessToken, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Entity Tag of the resource. + /// 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) + { + return new M365Extensions("M365Extensions", etag, provisioningState, location, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -618,6 +921,36 @@ public static MsTeamsChannel MsTeamsChannel(ETag? etag = null, string provisioni properties); } + /// Initializes a new instance of . + /// Entity Tag of the resource. + /// 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) + { + return new Omnichannel("Omnichannel", 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. + /// A new instance for mocking. + public static OutlookChannel OutlookChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + { + return new OutlookChannel("OutlookChannel", 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. + /// A new instance for mocking. + public static SearchAssistant SearchAssistant(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + { + return new SearchAssistant("SearchAssistant", etag, provisioningState, location, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Entity Tag of the resource. /// Provisioning state of the resource. @@ -635,16 +968,16 @@ public static SkypeChannel SkypeChannel(ETag? etag = null, string provisioningSt properties); } - /// Initializes a new instance of . + /// 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 Kik channel resource. - /// A new instance for mocking. - public static KikChannel KikChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, KikChannelProperties properties = null) + /// 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) { - return new KikChannel( - "KikChannel", + return new SlackChannel( + "SlackChannel", etag, provisioningState, location, @@ -652,16 +985,46 @@ public static KikChannel KikChannel(ETag? etag = null, string provisioningState properties); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The Slack client id. + /// The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty. + /// The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty. + /// The Slack permission scopes. + /// The Slack landing page Url. + /// The Slack redirect action. + /// The Sms auth token. + /// Whether to register the settings before OAuth validation is performed. Recommended to True. + /// Whether this channel is validated for the bot. + /// 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) + { + return new SlackChannelProperties( + clientId, + clientSecret, + verificationToken, + scopes, + landingPageUri, + redirectAction, + lastSubmissionId, + registerBeforeOAuthFlow, + isValidated, + signingSecret, + isEnabled, + 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 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) + /// 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) { - return new WebChatChannel( - "WebChatChannel", + return new SmsChannel( + "SmsChannel", etag, provisioningState, location, @@ -669,75 +1032,50 @@ public static WebChatChannel WebChatChannel(ETag? etag = null, string provisioni properties); } - /// Initializes a new instance of . - /// Web chat control embed code. - /// The list of Web Chat sites. - /// A new instance for mocking. - public static WebChatChannelProperties WebChatChannelProperties(string webChatEmbedCode = null, IEnumerable sites = 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 Telegram channel resource. + /// A new instance for mocking. + public static TelegramChannel TelegramChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, TelegramChannelProperties properties = null) { - sites ??= new List(); - - return new WebChatChannelProperties(webChatEmbedCode, sites?.ToList(), serializedAdditionalRawData: null); + return new TelegramChannel( + "TelegramChannel", + etag, + provisioningState, + location, + serializedAdditionalRawData: null, + properties); } - /// 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 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) + /// 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 Telephony channel resource. + /// A new instance for mocking. + public static TelephonyChannel TelephonyChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, TelephonyChannelProperties properties = null) { - trustedOrigins ??= new List(); - - return new WebChatSite( - tenantId, - siteId, - siteName, - key, - key2, - isEnabled, - isTokenEnabled, - isEndpointParametersEnabled, - isDetailedLoggingEnabled, - isBlockUserUploadEnabled, - isNoStorageEnabled, + return new TelephonyChannel( + "TelephonyChannel", etag, - appId, - isV1Enabled, - isV3Enabled, - isSecureSiteEnabled, - trustedOrigins?.ToList(), - isWebChatSpeechEnabled, - isWebchatPreviewEnabled, - serializedAdditionalRawData: null); + provisioningState, + location, + serializedAdditionalRawData: null, + properties); } - /// Initializes a new instance of . + /// 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) + /// 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) { - return new DirectLineChannel( - "DirectLineChannel", + return new WebChatChannel( + "WebChatChannel", etag, provisioningState, location, @@ -745,7 +1083,18 @@ public static DirectLineChannel DirectLineChannel(ETag? etag = null, string prov properties); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// Web chat control embed code. + /// The list of Web Chat sites. + /// A new instance for mocking. + public static WebChatChannelProperties WebChatChannelProperties(string webChatEmbedCode = null, IEnumerable sites = null) + { + sites ??= new List(); + + return new WebChatChannelProperties(webChatEmbedCode, sites?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// Tenant Id. /// Site Id. /// Site name. @@ -765,12 +1114,12 @@ public static DirectLineChannel DirectLineChannel(ETag? etag = null, string prov /// 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 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) + /// 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) { trustedOrigins ??= new List(); - return new DirectLineSite( + return new WebChatSite( tenantId, siteId, siteName, @@ -793,198 +1142,63 @@ public static DirectLineSite DirectLineSite(Guid? tenantId = null, string siteId 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 Telegram channel resource. - /// A new instance for mocking. - public static TelegramChannel TelegramChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, TelegramChannelProperties properties = null) - { - return new TelegramChannel( - "TelegramChannel", - etag, - provisioningState, - location, - serializedAdditionalRawData: null, - properties); - } - - /// 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 Sms channel resource. - /// A new instance for mocking. - public static SmsChannel SmsChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, SmsChannelProperties properties = null) - { - return new SmsChannel( - "SmsChannel", - etag, - provisioningState, - location, - serializedAdditionalRawData: null, - properties); - } - - /// 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 Slack channel resource. - /// A new instance for mocking. - public static SlackChannel SlackChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, SlackChannelProperties properties = null) - { - return new SlackChannel( - "SlackChannel", - etag, - provisioningState, - location, - serializedAdditionalRawData: null, - properties); - } - - /// Initializes a new instance of . - /// The Slack client id. - /// The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty. - /// The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty. - /// The Slack permission scopes. - /// The Slack landing page Url. - /// The Slack redirect action. - /// The Sms auth token. - /// Whether to register the settings before OAuth validation is performed. Recommended to True. - /// Whether this channel is validated for the bot. - /// 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) - { - return new SlackChannelProperties( - clientId, - clientSecret, - verificationToken, - scopes, - landingPageUri, - redirectAction, - lastSubmissionId, - registerBeforeOAuthFlow, - isValidated, - signingSecret, - isEnabled, - 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 line channel resource. - /// A new instance for mocking. - public static LineChannel LineChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, LineChannelProperties properties = null) - { - return new LineChannel( - "LineChannel", - etag, - provisioningState, - location, - serializedAdditionalRawData: null, - properties); - } - - /// Initializes a new instance of . - /// The list of line channel registrations. - /// 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) - { - lineRegistrations ??= new List(); - - return new LineChannelProperties(lineRegistrations?.ToList(), callbackUri, isValidated, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Id generated for the line channel registration. - /// Secret for the line channel registration. - /// Access token for the line channel registration. - /// A new instance for mocking. - public static LineRegistration LineRegistration(string generatedId = null, string channelSecret = null, string channelAccessToken = null) - { - return new LineRegistration(generatedId, channelSecret, channelAccessToken, 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 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) - { - return new DirectLineSpeechChannel( - "DirectLineSpeechChannel", - etag, - provisioningState, - location, - serializedAdditionalRawData: null, - properties); - } - - /// Initializes a new instance of . - /// Entity Tag of the resource. - /// 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) - { - return new Omnichannel("Omnichannel", 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 Telephony channel resource. - /// A new instance for mocking. - public static TelephonyChannel TelephonyChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, TelephonyChannelProperties properties = null) - { - return new TelephonyChannel( - "TelephonyChannel", - etag, - provisioningState, - location, - serializedAdditionalRawData: null, - properties); - } - - /// Initializes a new instance of . - /// Entity Tag of the resource. - /// 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) - { - return new AcsChatChannel("AcsChatChannel", etag, provisioningState, location, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Entity Tag of the resource. + /// Initializes a new instance of . + /// The Name of the bot. + /// The description of the bot. + /// The Icon Url of the bot. + /// The bot's endpoint. + /// The bot's endpoint version. + /// Contains resource all settings defined as key/value pairs. + /// Contains resource parameters defined as key/value pairs. + /// The bot's manifest url. + /// Microsoft App Type for the bot. + /// Microsoft App Id for the bot. + /// Microsoft App Tenant Id for the bot. + /// Microsoft App Managed Identity Resource Id for the bot. + /// Collection of channels for which the bot is configured. + /// Collection of channels for which the bot is enabled. + /// The Application Insights key. + /// The Application Insights Api Key. + /// The Application Insights App Id. + /// Collection of LUIS App Ids. + /// The LUIS Key. + /// Whether Cmek is enabled. + /// The CMK Url. + /// The CMK encryption status. + /// The Tenant Id for the bot. + /// Whether the bot is in an isolated network. + /// 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. + /// The channel schema transformation version for the bot. + /// The storage resourceId for the bot. + /// List of Private Endpoint Connections configured 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. - /// Specifies the location of the resource. - /// A new instance for mocking. - public static SearchAssistant SearchAssistant(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + /// Publishing credentials of the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BotProperties 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, IEnumerable configuredChannels, IEnumerable enabledChannels, string developerAppInsightKey, string developerAppInsightsApiKey, string developerAppInsightsApplicationId, IEnumerable 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, IEnumerable privateEndpointConnections, string openWithHint, string appPasswordHint, string provisioningState, string publishingCredentials) { - return new SearchAssistant("SearchAssistant", etag, provisioningState, location, serializedAdditionalRawData: null); + return BotProperties(displayName: displayName, description: description, iconUri: iconUri, endpoint: endpoint, endpointVersion: endpointVersion, allSettings: allSettings, parameters: parameters, manifestUri: manifestUri, msaAppType: msaAppType, msaAppId: msaAppId, msaAppTenantId: msaAppTenantId, msaAppMSIResourceId: msaAppMSIResourceId, configuredChannels: configuredChannels, enabledChannels: enabledChannels, developerAppInsightKey: developerAppInsightKey, developerAppInsightsApiKey: developerAppInsightsApiKey, developerAppInsightsApplicationId: developerAppInsightsApplicationId, luisAppIds: luisAppIds, luisKey: luisKey, isCmekEnabled: isCmekEnabled, cmekKeyVaultUri: cmekKeyVaultUri, cmekEncryptionStatus: cmekEncryptionStatus, tenantId: tenantId, publicNetworkAccess: publicNetworkAccess, isStreamingSupported: isStreamingSupported, isDeveloperAppInsightsApiKeySet: isDeveloperAppInsightsApiKeySet, migrationToken: migrationToken, isLocalAuthDisabled: isLocalAuthDisabled, schemaTransformationVersion: schemaTransformationVersion, storageResourceId: storageResourceId, privateEndpointConnections: privateEndpointConnections, networkSecurityPerimeterConfigurations: default, openWithHint: openWithHint, appPasswordHint: appPasswordHint, provisioningState: provisioningState, publishingCredentials: publishingCredentials); } - /// Initializes a new instance of . - /// Entity Tag of the resource. + /// 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. - /// Specifies the location of the resource. - /// A new instance for mocking. - public static M365Extensions M365Extensions(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static BotConnectionSettingProperties BotConnectionSettingProperties(string clientId, string settingId, string clientSecret, string scopes, string serviceProviderId, string serviceProviderDisplayName, IEnumerable parameters, string provisioningState) { - return new M365Extensions("M365Extensions", etag, provisioningState, location, serializedAdditionalRawData: null); + return BotConnectionSettingProperties(id: default, name: default, clientId: clientId, settingId: settingId, clientSecret: clientSecret, scopes: scopes, serviceProviderId: serviceProviderId, serviceProviderDisplayName: serviceProviderDisplayName, parameters: parameters, provisioningState: provisioningState); } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs index 34b0627e8819..e8ba2c4799ad 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -75,7 +75,7 @@ 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 parameters to provide for the created bot. + /// Resource create parameters. /// The cancellation token to use. /// is null. public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -124,7 +124,7 @@ 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 parameters to provide for the created bot. + /// Resource create parameters. /// The cancellation token to use. /// is null. public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -204,7 +204,7 @@ public virtual async Task> GetAsync(BotChannelName /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -245,7 +245,7 @@ public virtual Response Get(BotChannelName channelName, Canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -305,7 +305,7 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -344,7 +344,7 @@ public virtual async Task> ExistsAsync(BotChannelName channelName /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -383,7 +383,7 @@ public virtual Response Exists(BotChannelName channelName, CancellationTok /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -424,7 +424,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource 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 441d938bf466..d5618ec2bb0a 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.Serialization.cs @@ -50,15 +50,8 @@ 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)) { @@ -134,7 +127,6 @@ internal static BotChannelData DeserializeBotChannelData(JsonElement element, Mo { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs index fd3c52eaa023..131929cbc9d5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(BotChannelDa /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(BotChannelData data, Cancella /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -393,7 +393,7 @@ public virtual async Task> GetChannelWithK /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -431,7 +431,7 @@ public virtual Response GetChannelWithKeys(Cancella /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -493,7 +493,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -555,7 +555,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -612,7 +612,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -669,7 +669,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -729,7 +729,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs index 1b6c5155c078..b036c4c3a0e5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsync(WaitUnt /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, str /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string resourceName, C /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string resourceName, CancellationToken /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken cancella /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancellationToken /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExistsAsync(string /// /// /// 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/BotConnectionSettingCollection.cs index 53b4b881c2e2..76c1f2dfdafd 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string connectionName, /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string connectionName, Can /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string connectionName, CancellationToken ca /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs index 069fc54e28e6..d6b9932990e3 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs @@ -50,15 +50,8 @@ 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)) { @@ -134,7 +127,6 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs index 99bf5954c4cd..10af6c37d4ef 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Bo /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual Response Update(BotConnectionSettin /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -392,7 +392,7 @@ public virtual async Task> GetWithSecrets /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -430,7 +430,7 @@ public virtual Response GetWithSecrets(Cancellatio /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -492,7 +492,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -554,7 +554,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -611,7 +611,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -668,7 +668,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -728,7 +728,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource 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 a1371a1f2839..2db0e324a842 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.Serialization.cs @@ -50,15 +50,8 @@ 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)) { @@ -134,7 +127,6 @@ internal static BotData DeserializeBotData(JsonElement element, ModelReaderWrite { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs index 46239c8b13c4..67c03c115fe2 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs @@ -103,6 +103,75 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of BotConnectionSettingResources in the Bot. + /// An object representing collection of BotConnectionSettingResources and their operations over a BotConnectionSettingResource. + public virtual BotConnectionSettingCollection GetBotConnectionSettings() + { + return GetCachedClient(client => new BotConnectionSettingCollection(client, Id)); + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName} + /// + /// + /// Operation Id + /// BotConnection_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBotConnectionSettingAsync(string connectionName, CancellationToken cancellationToken = default) + { + return await GetBotConnectionSettings().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Connection Setting registration for a Bot Service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName} + /// + /// + /// Operation Id + /// BotConnection_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Bot Service Connection Setting resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBotConnectionSetting(string connectionName, CancellationToken cancellationToken = default) + { + return GetBotConnectionSettings().Get(connectionName, cancellationToken); + } + /// Gets a collection of BotChannelResources in the Bot. /// An object representing collection of BotChannelResources and their operations over a BotChannelResource. public virtual BotChannelCollection GetBotChannels() @@ -123,7 +192,7 @@ public virtual BotChannelCollection GetBotChannels() /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -152,7 +221,7 @@ public virtual async Task> GetBotChannelAsync(BotCh /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -168,73 +237,73 @@ public virtual Response GetBotChannel(BotChannelName channel 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 NetworkSecurityPerimeterConfigurationResources in the Bot. + /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. + public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() { - return GetCachedClient(client => new BotConnectionSettingCollection(client, Id)); + return GetCachedClient(client => new NetworkSecurityPerimeterConfigurationCollection(client, Id)); } /// - /// Get a Connection Setting registration for a Bot Service + /// Gets the specified Network Security Perimeter configuration associated with the Bot. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} /// /// /// Operation Id - /// BotConnection_Get + /// NetworkSecurityPerimeterConfigurations_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the Bot Service Connection Setting 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. + /// 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> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) { - return await GetBotConnectionSettings().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); + return await GetNetworkSecurityPerimeterConfigurations().GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Connection Setting registration for a Bot Service + /// Gets the specified Network Security Perimeter configuration associated with the Bot. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} /// /// /// Operation Id - /// BotConnection_Get + /// NetworkSecurityPerimeterConfigurations_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the Bot Service Connection Setting 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. + /// 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 GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) { - return GetBotConnectionSettings().Get(connectionName, cancellationToken); + return GetNetworkSecurityPerimeterConfigurations().Get(networkSecurityPerimeterConfigurationName, cancellationToken); } /// Gets a collection of BotServicePrivateEndpointConnectionResources in the Bot. @@ -257,7 +326,7 @@ public virtual BotServicePrivateEndpointConnectionCollection GetBotServicePrivat /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -288,7 +357,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -319,7 +388,7 @@ public virtual Response GetBotServi /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -359,7 +428,7 @@ public virtual async Task> GetAsync(CancellationToken canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -399,7 +468,7 @@ public virtual Response Get(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -443,7 +512,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -487,7 +556,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -529,7 +598,7 @@ public virtual async Task> UpdateAsync(BotData data, Cance /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -571,7 +640,7 @@ public virtual Response Update(BotData data, CancellationToken canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// @@ -610,7 +679,7 @@ public virtual async Task> GetBotChannelWithRegener /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// @@ -649,7 +718,7 @@ public virtual Response GetBotChannelWithRegenerateKeys(Rege /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// @@ -683,7 +752,7 @@ public virtual async Task> CreateEmailSi /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// @@ -717,7 +786,7 @@ public virtual Response CreateEmailSignInUri(Canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// @@ -742,7 +811,7 @@ public virtual AsyncPageable GetPrivateLinkRe /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// @@ -767,7 +836,7 @@ public virtual Pageable GetPrivateLinkResourc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -829,7 +898,7 @@ public virtual async Task> AddTagAsync(string key, string /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -891,7 +960,7 @@ public virtual Response AddTag(string key, string value, Cancellati /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -948,7 +1017,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -1005,7 +1074,7 @@ public virtual Response SetTags(IDictionary tags, C /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -1065,7 +1134,7 @@ public virtual async Task> RemoveTagAsync(string key, Canc /// /// /// 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..6cc6f4838784 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string /// /// /// 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); } /// @@ -285,7 +286,7 @@ public virtual AsyncPageable GetAll /// /// /// 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); } /// @@ -314,7 +316,7 @@ public virtual Pageable GetAll(Canc /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -357,7 +359,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -400,7 +402,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -445,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs index f401e9c22ca5..e0de73f7d6aa 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource 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..9f54964cc38b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs @@ -57,6 +57,25 @@ public static BotResource GetBotResource(this ArmClient client, ResourceIdentifi return GetMockableBotServiceArmClient(client).GetBotResource(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 BotConnectionSettingResource GetBotConnectionSettingResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableBotServiceArmClient(client).GetBotConnectionSettingResource(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. @@ -77,22 +96,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 NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableBotServiceArmClient(client).GetBotConnectionSettingResource(id); + return GetMockableBotServiceArmClient(client).GetNetworkSecurityPerimeterConfigurationResource(id); } /// @@ -144,7 +163,7 @@ public static BotCollection GetBots(this ResourceGroupResource resourceGroupReso /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -182,7 +201,7 @@ public static async Task> GetBotAsync(this ResourceGroupRe /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -220,7 +239,7 @@ public static Response GetBot(this ResourceGroupResource resourceGr /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -256,7 +275,7 @@ public static AsyncPageable GetBotsAsync(this SubscriptionResource /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -280,201 +299,201 @@ public static Pageable GetBots(this SubscriptionResource subscripti } /// - /// Lists the available Service Providers for creating Connection Settings + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings /// /// /// Operation Id - /// BotConnection_ListServiceProviders + /// HostSettings_Get /// /// /// 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) + public static async Task> GetBotServiceHostSettingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotConnectionServiceProvidersAsync(cancellationToken); + return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceHostSettingsAsync(cancellationToken).ConfigureAwait(false); } /// - /// Lists the available Service Providers for creating Connection Settings + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings /// /// /// Operation Id - /// BotConnection_ListServiceProviders + /// HostSettings_Get /// /// /// 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) + public static Response GetBotServiceHostSettings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotConnectionServiceProviders(cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceHostSettings(cancellationToken); } /// - /// Lists the QnA Maker endpoint keys + /// Lists the available Service Providers for creating Connection Settings /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders /// /// /// Operation Id - /// QnAMakerEndpointKeys_Get + /// BotConnection_ListServiceProviders /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview + /// + /// + /// Resource + /// /// /// /// /// 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 cancellation token to use. - /// or is null. - public static async Task> GetBotServiceQnAMakerEndpointKeyAsync(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + /// 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) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceQnAMakerEndpointKeyAsync(content, cancellationToken).ConfigureAwait(false); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotConnectionServiceProvidersAsync(cancellationToken); } /// - /// Lists the QnA Maker endpoint keys + /// Lists the available Service Providers for creating Connection Settings /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders /// /// /// Operation Id - /// QnAMakerEndpointKeys_Get + /// BotConnection_ListServiceProviders /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview + /// + /// + /// Resource + /// /// /// /// /// 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 cancellation token to use. - /// or is null. - public static Response GetBotServiceQnAMakerEndpointKey(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetBotConnectionServiceProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceQnAMakerEndpointKey(content, cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotConnectionServiceProviders(cancellationToken); } /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// Lists the QnA Maker endpoint keys /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys /// /// /// Operation Id - /// HostSettings_Get + /// QnAMakerEndpointKeys_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. /// The cancellation token to use. - /// is null. - public static async Task> GetBotServiceHostSettingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> GetBotServiceQnAMakerEndpointKeyAsync(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceHostSettingsAsync(cancellationToken).ConfigureAwait(false); + return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceQnAMakerEndpointKeyAsync(content, cancellationToken).ConfigureAwait(false); } /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// Lists the QnA Maker endpoint keys /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/listQnAMakerEndpointKeys /// /// /// Operation Id - /// HostSettings_Get + /// QnAMakerEndpointKeys_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. /// The cancellation token to use. - /// is null. - public static Response GetBotServiceHostSettings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static Response GetBotServiceQnAMakerEndpointKey(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceHostSettings(cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceQnAMakerEndpointKey(content, cancellationToken); } /// @@ -490,7 +509,7 @@ public static Response GetBotServiceHostSettings(t /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -503,7 +522,7 @@ public static Response GetBotServiceHostSettings(t /// /// /// 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> CheckBotServiceNameAvailabilityAsync(this TenantResource tenantResource, BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) @@ -526,7 +545,7 @@ public static async Task> CheckBotSer /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -539,7 +558,7 @@ public static async Task> CheckBotSer /// /// /// 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) 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..308cc33a832d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceArmClient.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceArmClient.cs @@ -46,6 +46,18 @@ public virtual BotResource GetBotResource(ResourceIdentifier id) return new BotResource(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 BotConnectionSettingResource GetBotConnectionSettingResource(ResourceIdentifier id) + { + BotConnectionSettingResource.ValidateResourceId(id); + return new BotConnectionSettingResource(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. @@ -59,15 +71,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 NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(ResourceIdentifier id) { - BotConnectionSettingResource.ValidateResourceId(id); - return new BotConnectionSettingResource(Client, 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..f231b98eb0c6 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceResourceGroupResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual BotCollection GetBots() /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetBotAsync(string resourceName /// /// /// 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..0269d683dca3 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,12 @@ public partial class MockableBotServiceSubscriptionResource : ArmResource { private ClientDiagnostics _botClientDiagnostics; private BotsRestOperations _botRestClient; + private ClientDiagnostics _hostSettingsClientDiagnostics; + private HostSettingsRestOperations _hostSettingsRestClient; private ClientDiagnostics _botConnectionSettingBotConnectionClientDiagnostics; private BotConnectionRestOperations _botConnectionSettingBotConnectionRestClient; private ClientDiagnostics _qnAMakerEndpointKeysClientDiagnostics; private QnAMakerEndpointKeysRestOperations _qnAMakerEndpointKeysRestClient; - private ClientDiagnostics _hostSettingsClientDiagnostics; - private HostSettingsRestOperations _hostSettingsRestClient; /// Initializes a new instance of the class for mocking. protected MockableBotServiceSubscriptionResource() @@ -41,12 +41,12 @@ 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 HostSettingsClientDiagnostics => _hostSettingsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private HostSettingsRestOperations HostSettingsRestClient => _hostSettingsRestClient ??= new HostSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); 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 string GetApiVersionOrNull(ResourceType resourceType) { @@ -67,7 +67,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -97,7 +97,7 @@ public virtual AsyncPageable GetBotsAsync(CancellationToken cancell /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -114,6 +114,74 @@ public virtual Pageable GetBots(CancellationToken cancellationToken return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotResource(Client, BotData.DeserializeBotData(e)), BotClientDiagnostics, Pipeline, "MockableBotServiceSubscriptionResource.GetBots", "value", "nextLink", cancellationToken); } + /// + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings + /// + /// + /// Operation Id + /// HostSettings_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetBotServiceHostSettingsAsync(CancellationToken cancellationToken = default) + { + using var scope = HostSettingsClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceHostSettings"); + scope.Start(); + try + { + var response = await HostSettingsRestClient.GetAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get per subscription settings needed to host bot in compute resource such as Azure App Service + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings + /// + /// + /// Operation Id + /// HostSettings_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetBotServiceHostSettings(CancellationToken cancellationToken = default) + { + using var scope = HostSettingsClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceHostSettings"); + scope.Start(); + try + { + var response = HostSettingsRestClient.Get(Id.SubscriptionId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Lists the available Service Providers for creating Connection Settings /// @@ -127,7 +195,7 @@ public virtual Pageable GetBots(CancellationToken cancellationToken /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -156,7 +224,7 @@ public virtual AsyncPageable GetBotConnectionServiceProvider /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -185,11 +253,11 @@ public virtual Pageable GetBotConnectionServiceProviders(Can /// /// /// 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) @@ -223,11 +291,11 @@ public virtual async Task> GetB /// /// /// 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) @@ -247,73 +315,5 @@ public virtual Response GetBotServiceQnA throw; } } - - /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings - /// - /// - /// Operation Id - /// HostSettings_Get - /// - /// - /// Default Api Version - /// 2022-09-15 - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetBotServiceHostSettingsAsync(CancellationToken cancellationToken = default) - { - using var scope = HostSettingsClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceHostSettings"); - scope.Start(); - try - { - var response = await HostSettingsRestClient.GetAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get per subscription settings needed to host bot in compute resource such as Azure App Service - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings - /// - /// - /// Operation Id - /// HostSettings_Get - /// - /// - /// Default Api Version - /// 2022-09-15 - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetBotServiceHostSettings(CancellationToken cancellationToken = default) - { - using var scope = HostSettingsClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceHostSettings"); - scope.Start(); - try - { - var response = HostSettingsRestClient.Get(Id.SubscriptionId, cancellationToken); - return response; - } - 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..e39f76d9d93c 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceTenantResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceTenantResource.cs @@ -54,7 +54,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -62,7 +62,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// - /// 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) @@ -96,7 +96,7 @@ public virtual async Task> CheckBotSe /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -104,7 +104,7 @@ public virtual async Task> CheckBotSe /// /// /// - /// 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) 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/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/AzureResourceManagerBotServiceContext.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AzureResourceManagerBotServiceContext.cs index a70bf1a41d75..04a0f66569a1 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AzureResourceManagerBotServiceContext.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AzureResourceManagerBotServiceContext.cs @@ -70,8 +70,20 @@ namespace Azure.ResourceManager.BotService [ModelReaderWriterBuildable(typeof(M365Extensions))] [ModelReaderWriterBuildable(typeof(MsTeamsChannel))] [ModelReaderWriterBuildable(typeof(MsTeamsChannelProperties))] + [ModelReaderWriterBuildable(typeof(NetworkSecurityPerimeter))] + [ModelReaderWriterBuildable(typeof(NetworkSecurityPerimeterConfigurationData))] + [ModelReaderWriterBuildable(typeof(NetworkSecurityPerimeterConfigurationList))] + [ModelReaderWriterBuildable(typeof(NetworkSecurityPerimeterConfigurationProperties))] + [ModelReaderWriterBuildable(typeof(NetworkSecurityPerimeterConfigurationResource))] + [ModelReaderWriterBuildable(typeof(NspAccessRule))] + [ModelReaderWriterBuildable(typeof(NspAccessRuleProperties))] [ModelReaderWriterBuildable(typeof(Omnichannel))] [ModelReaderWriterBuildable(typeof(OutlookChannel))] + [ModelReaderWriterBuildable(typeof(Profile))] + [ModelReaderWriterBuildable(typeof(ProvisioningIssue))] + [ModelReaderWriterBuildable(typeof(ProvisioningIssueProperties))] + [ModelReaderWriterBuildable(typeof(ResourceAssociation))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SearchAssistant))] [ModelReaderWriterBuildable(typeof(ServiceProviderParameterMetadata))] [ModelReaderWriterBuildable(typeof(ServiceProviderParameterMetadataConstraints))] diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs index 5fc92277fb1a..3f5e8613c157 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs @@ -74,15 +74,8 @@ 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)) { @@ -196,7 +189,6 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs index 5e266153cc15..026c94af52f8 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs @@ -34,6 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(BotConnectionSettingProperties)} 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); @@ -116,6 +126,8 @@ internal static BotConnectionSettingProperties DeserializeBotConnectionSettingPr { return null; } + string id = default; + string name = default; string clientId = default; string settingId = default; string clientSecret = default; @@ -128,6 +140,16 @@ internal static BotConnectionSettingProperties DeserializeBotConnectionSettingPr 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(); @@ -184,6 +206,8 @@ internal static BotConnectionSettingProperties DeserializeBotConnectionSettingPr } serializedAdditionalRawData = rawDataDictionary; return new BotConnectionSettingProperties( + id, + name, clientId, settingId, clientSecret, diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs index 7e817b59db86..62ae66b0d931 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs @@ -52,6 +52,8 @@ public BotConnectionSettingProperties() } /// 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 BotConnectionSettingProperties(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. 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..d5362998e4c7 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 @@ -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); @@ -314,6 +324,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode string schemaTransformationVersion = default; ResourceIdentifier storageResourceId = default; IReadOnlyList privateEndpointConnections = default; + IReadOnlyList networkSecurityPerimeterConfigurations = default; string openWithHint = default; string appPasswordHint = default; string provisioningState = default; @@ -589,6 +600,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 +672,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..e14ca9512c5a 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.cs @@ -65,6 +65,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 . @@ -99,12 +100,13 @@ public BotProperties(string displayName, Uri endpoint, string msaAppId) /// 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, 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, IReadOnlyList networkSecurityPerimeterConfigurations, string openWithHint, string appPasswordHint, string provisioningState, string publishingCredentials, IDictionary serializedAdditionalRawData) { DisplayName = displayName; Description = description; @@ -137,6 +139,7 @@ internal BotProperties(string displayName, string description, Uri iconUri, Uri SchemaTransformationVersion = schemaTransformationVersion; StorageResourceId = storageResourceId; PrivateEndpointConnections = privateEndpointConnections; + NetworkSecurityPerimeterConfigurations = networkSecurityPerimeterConfigurations; OpenWithHint = openWithHint; AppPasswordHint = appPasswordHint; ProvisioningState = provisioningState; @@ -211,6 +214,8 @@ internal BotProperties() public ResourceIdentifier 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.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs index 14ff6c65f59b..51e1f8fe9c7c 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs @@ -47,13 +47,6 @@ public partial class BotServicePrivateLinkResourceData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BotServicePrivateLinkResourceData() - { - RequiredMembers = new ChangeTrackingList(); - RequiredZoneNames = new ChangeTrackingList(); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -75,7 +68,5 @@ internal BotServicePrivateLinkResourceData(ResourceIdentifier id, string name, R public string GroupId { get; } /// The private link resource required member names. public IReadOnlyList RequiredMembers { get; } - /// The private link resource Private link DNS zone name. - public IList 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 index 26b2b4a2bd65..632ddc9a8884 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePublicNetworkAccess.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePublicNetworkAccess.cs @@ -24,11 +24,14 @@ public BotServicePublicNetworkAccess(string value) private const string EnabledValue = "Enabled"; private const string DisabledValue = "Disabled"; + private const string SecuredByPerimeterValue = "SecuredByPerimeter"; /// Enabled. public static BotServicePublicNetworkAccess Enabled { get; } = new BotServicePublicNetworkAccess(EnabledValue); /// Disabled. public static BotServicePublicNetworkAccess Disabled { get; } = new BotServicePublicNetworkAccess(DisabledValue); + /// SecuredByPerimeter. + public static BotServicePublicNetworkAccess SecuredByPerimeter { get; } = new BotServicePublicNetworkAccess(SecuredByPerimeterValue); /// 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. 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/ConnectionSettingResponseList.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.Serialization.cs index 0ecf5db1ac8d..f4dc009d34bb 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,23 +86,14 @@ internal static ConnectionSettingResponseList DeserializeConnectionSettingRespon { 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 ConnectionSettingResponseList DeserializeConnectionSettingRespon 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 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..3f78bf4ea8f2 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. + /// 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/NetworkSecurityPerimeter.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs new file mode 100644 index 000000000000..b8242694aa8d --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs @@ -0,0 +1,159 @@ +// 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.Value); + } + 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; + AzureLocation? 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)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(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..970cc57de07f --- /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, AzureLocation? 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 AzureLocation? 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..8a456f80f3c1 --- /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; + IList 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..3ee56f72b26c --- /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 . + public 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, IList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, ResourceAssociation resourceAssociation, Profile profile, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ProvisioningIssues = provisioningIssues; + NetworkSecurityPerimeter = networkSecurityPerimeter; + ResourceAssociation = resourceAssociation; + Profile = profile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state. + public ProvisioningState? ProvisioningState { get; set; } + /// List of Provisioning Issues if any. + public IList 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/NspAccessRule.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.Serialization.cs new file mode 100644 index 000000000000..2ae368d1b6cd --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.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 NspAccessRule : 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(NspAccessRule)} 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 + } + } + } + + NspAccessRule 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(NspAccessRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNspAccessRule(document.RootElement, options); + } + + internal static NspAccessRule DeserializeNspAccessRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + NspAccessRuleProperties 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 = NspAccessRuleProperties.DeserializeNspAccessRuleProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NspAccessRule(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(NspAccessRule)} does not support writing '{options.Format}' format."); + } + } + + NspAccessRule 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 DeserializeNspAccessRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NspAccessRule)} does not support reading '{options.Format}' format."); + } + } + + 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..67b9cd5a9fba --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.Serialization.cs @@ -0,0 +1,293 @@ +// 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; +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) + { + ((IJsonModel)item).Write(writer, options); + } + 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(ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(item.GetRawText())), options, AzureResourceManagerBotServiceContext.Default)); + } + 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/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..4b68b23ee0ec --- /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 . + public 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; set; } + /// 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..dceede4f9832 --- /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; + Severity? 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 Severity(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..3197829e402e --- /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, Severity? 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 Severity? 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/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/Severity.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Severity.cs new file mode 100644 index 000000000000..b43c30827340 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Severity.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 Severity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Severity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WarningValue = "Warning"; + private const string ErrorValue = "Error"; + + /// Warning. + public static Severity Warning { get; } = new Severity(WarningValue); + /// Error. + public static Severity Error { get; } = new Severity(ErrorValue); + /// Determines if two values are the same. + public static bool operator ==(Severity left, Severity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Severity left, Severity right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Severity(string value) => new Severity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Severity other && Equals(other); + /// + public bool Equals(Severity 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/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs new file mode 100644 index 000000000000..8f5821e41f46 --- /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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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..1af5f8561e29 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs @@ -0,0 +1,156 @@ +// 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; +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 = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerBotServiceContext.Default); + 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..e52cdc06650c --- /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 . + public 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; set; } + } +} 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..15f060de481d --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs @@ -0,0 +1,29 @@ +// 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 + { + private static NetworkSecurityPerimeterConfigurationData s_dataDeserializationInstance; + private static NetworkSecurityPerimeterConfigurationData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).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)DataDeserializationInstance).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..8e6aa849b3bd --- /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 + /// NetworkSecurityPerimeterConfigurations_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 + /// NetworkSecurityPerimeterConfigurations_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/BotConnectionRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionRestOperations.cs index e578bed51a54..2ddc69e0b6ef 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionRestOperations.cs @@ -32,7 +32,7 @@ public BotConnectionRestOperations(HttpPipeline pipeline, string applicationId, { _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,7 +65,7 @@ internal HttpMessage CreateListServiceProvidersRequest(string subscriptionId) } /// Lists the available Service Providers for creating Connection Settings. - /// Azure Subscription ID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListServiceProvidersAsy } /// Lists the available Service Providers for creating Connection Settings. - /// Azure Subscription ID. + /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -114,7 +114,7 @@ public Response ListServiceProviders(string subscri } } - internal RequestUriBuilder CreateListWithSecretsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal RequestUriBuilder CreateListByBotServiceRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -124,18 +124,16 @@ internal RequestUriBuilder CreateListWithSecretsRequestUri(string subscriptionId 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("/listWithSecrets", false); + uri.AppendPath("/connections", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListWithSecretsRequest(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.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -144,9 +142,7 @@ internal HttpMessage CreateListWithSecretsRequest(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("/listWithSecrets", false); + uri.AppendPath("/connections", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -154,30 +150,28 @@ internal HttpMessage CreateListWithSecretsRequest(string subscriptionId, string 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. + /// Returns all the Connection Settings registered to a particular BotService resource. + /// The ID of the target subscription. + /// 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) + /// , 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 = CreateListWithSecretsRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateListByBotServiceRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotConnectionSettingData value = default; + ConnectionSettingResponseList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -185,30 +179,28 @@ public async Task> ListWithSecretsAsync(strin } } - /// Get 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 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) + /// , 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 = CreateListWithSecretsRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateListByBotServiceRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotConnectionSettingData value = default; + ConnectionSettingResponseList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -216,7 +208,7 @@ public Response ListWithSecrets(string subscriptionId, } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -232,11 +224,11 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -250,83 +242,77 @@ 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; } - /// Register a new Auth Connection for a Bot Service. - /// 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 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 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> 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)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { 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); default: throw new RequestFailedException(message.Response); } } - /// Register a new Auth Connection for a Bot Service. - /// 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 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 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 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)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { 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); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -342,11 +328,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -368,16 +354,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG return message; } - /// Updates a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Register a new Auth Connection for a Bot Service. + /// The ID of the target subscription. + /// 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 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> UpdateAsync(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, BotConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -385,7 +371,7 @@ public async Task> UpdateAsync(string subscri Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -402,16 +388,16 @@ 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. + /// Register a new Auth Connection for a Bot Service. + /// The ID of the target subscription. + /// 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 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 Update(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -419,7 +405,7 @@ public Response Update(string subscriptionId, string r Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -436,7 +422,7 @@ public Response Update(string subscriptionId, string r } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -452,11 +438,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -470,71 +456,77 @@ 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; } - /// Get a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Updates a Connection Setting registration for a Bot Service. + /// The ID of the target subscription. + /// 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 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> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { 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); 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. + /// Updates a Connection Setting registration for a Bot Service. + /// The ID of the target subscription. + /// 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 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 Update(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, connectionName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { 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); default: throw new RequestFailedException(message.Response); } @@ -579,8 +571,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes 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 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. @@ -606,8 +598,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes 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 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. @@ -632,7 +624,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - 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 +634,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 +654,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 +664,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 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; + BotConnectionSettingData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); + value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -697,28 +695,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 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; + BotConnectionSettingData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); + value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -750,8 +750,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 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 +781,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 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/BotsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs index 59c8c93866fc..ba3dd1210fb4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs @@ -32,73 +32,55 @@ public BotsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _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, BotData data) + internal RequestUriBuilder CreateGetCheckNameAvailabilityRequestUri(BotServiceNameAvailabilityContent 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("/providers/Microsoft.BotService/checkNameAvailability", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotData data) + internal HttpMessage CreateGetCheckNameAvailabilityRequest(BotServiceNameAvailabilityContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + 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("/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(data, ModelSerializationExtensions.WireOptions); - request.Content = content; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// 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 name of the Bot resource. - /// The parameters to provide for the created bot. + /// Check whether a bot name is available. + /// The request body. /// 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, BotData data, CancellationToken cancellationToken = default) + /// is null. + public async Task> GetCheckNameAvailabilityAsync(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateGetCheckNameAvailabilityRequest(content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { - BotData value = default; + BotServiceNameAvailabilityResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotData.DeserializeBotData(document.RootElement); + value = BotServiceNameAvailabilityResult.DeserializeBotServiceNameAvailabilityResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -106,31 +88,23 @@ 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 name of the Bot resource. - /// The parameters to provide for the created bot. + /// Check whether a bot name is available. + /// The request body. /// 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, BotData data, CancellationToken cancellationToken = default) + /// is null. + public Response GetCheckNameAvailability(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateGetCheckNameAvailabilityRequest(content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { - BotData value = default; + BotServiceNameAvailabilityResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotData.DeserializeBotData(document.RootElement); + value = BotServiceNameAvailabilityResult.DeserializeBotServiceNameAvailabilityResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -138,69 +112,52 @@ public Response Create(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotData data) + 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.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotData data) + internal HttpMessage CreateListRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + 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("/providers/Microsoft.BotService/botServices", 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(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Updates a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The parameters to provide for the created bot. + /// Returns all the resources of a particular type belonging to a subscription. + /// The ID of the target subscription. /// 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, BotData data, 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)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateListRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { - 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); } default: @@ -208,31 +165,24 @@ 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 name of the Bot resource. - /// The parameters to provide for the created bot. + /// Returns all the resources of a particular type belonging to a subscription. + /// The ID of the target subscription. /// 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, BotData data, 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)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); + using var message = CreateListRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { - 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); } default: @@ -240,7 +190,7 @@ public Response Update(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -248,25 +198,23 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string 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 CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { 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); 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"); @@ -274,51 +222,55 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes a Bot Service from the resource group. - /// 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 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 DeleteAsync(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 = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + BotResponseList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BotResponseList.DeserializeBotResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Deletes a Bot Service from the resource group. - /// 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 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 Delete(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 = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + BotResponseList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BotResponseList.DeserializeBotResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -359,8 +311,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Returns a BotService specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -390,8 +342,8 @@ public async Task> GetAsync(string subscriptionId, string reso } /// Returns a BotService specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -420,7 +372,7 @@ public Response Get(string subscriptionId, string resourceGroupName, st } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -428,50 +380,61 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices", false); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotData 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); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices", false); + 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"); + 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; } - /// 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. + /// Creates a Bot Service. Bot Service is a resource group wide resource type. + /// The ID of the target subscription. + /// 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. - /// 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) + /// , , 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, BotData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { - BotResponseList value = default; + BotData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotResponseList.DeserializeBotResponseList(document.RootElement); + value = BotData.DeserializeBotData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -479,26 +442,31 @@ 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. + /// Creates a Bot Service. Bot Service is a resource group wide resource type. + /// The ID of the target subscription. + /// 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. - /// 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) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string resourceName, BotData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { - BotResponseList value = default; + BotData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotResponseList.DeserializeBotResponseList(document.RootElement); + value = BotData.DeserializeBotData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -506,52 +474,69 @@ public Response ListByResourceGroup(string subscriptionId, stri } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotData data) { 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.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; 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.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; } - /// Returns all the resources of a particular type belonging to a subscription. - /// Azure Subscription ID. + /// Updates a Bot Service. + /// The ID of the target subscription. + /// 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. - /// 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> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, BotData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { - BotResponseList value = default; + BotData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotResponseList.DeserializeBotResponseList(document.RootElement); + value = BotData.DeserializeBotData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -559,24 +544,31 @@ public async Task> ListAsync(string subscriptionId, Ca } } - /// Returns all the resources of a particular type belonging to a subscription. - /// Azure Subscription ID. + /// Updates a Bot Service. + /// The ID of the target subscription. + /// 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. - /// 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 Update(string subscriptionId, string resourceGroupName, string resourceName, BotData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { - BotResponseList value = default; + BotData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotResponseList.DeserializeBotResponseList(document.RootElement); + value = BotData.DeserializeBotData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -584,83 +576,91 @@ public Response List(string subscriptionId, CancellationToken c } } - internal RequestUriBuilder CreateGetCheckNameAvailabilityRequestUri(BotServiceNameAvailabilityContent content) + internal RequestUriBuilder CreateDeleteRequestUri(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.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetCheckNameAvailabilityRequest(BotServiceNameAvailabilityContent content) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; 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.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. + /// Deletes a Bot Service from the resource group. + /// The ID of the target subscription. + /// 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 DeleteAsync(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 = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - BotServiceNameAvailabilityResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotServiceNameAvailabilityResult.DeserializeBotServiceNameAvailabilityResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Check whether a bot name is available. - /// The request body parameters to provide for the check name availability request. + /// Deletes a Bot Service from the resource group. + /// The ID of the target subscription. + /// 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 Delete(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 = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - BotServiceNameAvailabilityResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotServiceNameAvailabilityResult.DeserializeBotServiceNameAvailabilityResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -668,7 +668,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -682,20 +682,18 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Returns all the resources of a particular type belonging to a resource group. + /// Returns all the resources of a particular type belonging to a subscription. /// 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 cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -711,20 +709,18 @@ public async Task> ListByResourceGroupNextPageAsync(st } } - /// Returns all the resources of a particular type belonging to a resource group. + /// Returns all the resources of a particular type belonging to a subscription. /// 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 cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -740,7 +736,7 @@ public Response ListByResourceGroupNextPage(string nextLink, st } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -748,7 +744,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -762,18 +758,20 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Returns all the resources of a particular type belonging to a subscription. + /// 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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -789,18 +787,20 @@ public async Task> ListNextPageAsync(string nextLink, } } - /// Returns all the resources of a particular type belonging to a subscription. + /// 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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs index c88c8c2c529d..673c227dc487 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs @@ -32,11 +32,11 @@ public ChannelsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _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 CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,17 +46,16 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string 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 CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -65,45 +64,36 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG 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"); - 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; } - /// Creates a Channel registration for a Bot Service. - /// 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 name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. - /// The parameters to provide for the created bot. /// 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, BotChannelName channelName, BotChannelData data, 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)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { - 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); } default: @@ -111,32 +101,28 @@ 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. + /// Returns all the Channel registrations of a particular BotService resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. - /// The parameters to provide for the created bot. /// 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, BotChannelName channelName, BotChannelData data, 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)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { - 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); } default: @@ -144,7 +130,7 @@ public Response Create(string subscriptionId, string resourceGro } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -160,11 +146,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -178,81 +164,75 @@ internal HttpMessage CreateUpdateRequest(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; } - /// Updates a Channel registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns a BotService Channel registration specified by the parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Channel resource. - /// The parameters to provide for the created bot. /// 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> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { 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); } } - /// Updates a Channel registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns a BotService Channel registration specified by the parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Channel resource. - /// The parameters to provide for the created bot. /// 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 Update(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { 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 CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -268,11 +248,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -286,63 +266,81 @@ internal HttpMessage CreateDeleteRequest(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; } - /// Deletes a Channel registration from a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Creates a Channel registration for a Bot Service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Channel resource. + /// Resource create parameters. /// 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 DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + case 201: + { + 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); } } - /// Deletes a Channel registration from a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Creates a Channel registration for a Bot Service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Channel resource. + /// Resource create parameters. /// 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 Delete(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + case 201: + { + 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); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -358,11 +356,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -376,75 +374,81 @@ 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; } - /// Returns a BotService Channel registration specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Updates a Channel registration for a Bot Service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Channel resource. + /// The parameters to provide for the created bot. /// 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, BotChannelName channelName, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { 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. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Updates a Channel registration for a Bot Service. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Channel resource. + /// The parameters to provide for the created bot. /// 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, BotChannelName channelName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { 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 CreateListWithKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -456,16 +460,15 @@ internal RequestUriBuilder CreateListWithKeysRequestUri(string subscriptionId, s uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); uri.AppendPath(channelName.ToString(), 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 CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -476,7 +479,6 @@ internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string res uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); uri.AppendPath(channelName.ToString(), true); - uri.AppendPath("/listChannelWithKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -484,67 +486,59 @@ internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string res return message; } - /// Lists a Channel registration for a Bot Service including secrets. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Deletes a Channel registration from a Bot Service. + /// The ID of the target subscription. + /// 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> ListWithKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListWithKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, channelName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - BotChannelGetWithKeysResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotChannelGetWithKeysResult.DeserializeBotChannelGetWithKeysResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Lists a Channel registration for a Bot Service including secrets. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Deletes a Channel registration from a Bot Service. + /// The ID of the target subscription. + /// 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 ListWithKeys(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListWithKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, channelName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - BotChannelGetWithKeysResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotChannelGetWithKeysResult.DeserializeBotChannelGetWithKeysResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListWithKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -554,16 +548,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.ToString(), true); + uri.AppendPath("/listChannelWithKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) { 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,7 +568,9 @@ 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.ToString(), true); + uri.AppendPath("/listChannelWithKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -580,28 +578,29 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str 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. + /// Lists a Channel registration for a Bot Service including secrets. + /// The ID of the target subscription. + /// 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> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + public async Task> ListWithKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListWithKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChannelResponseList value = default; + BotChannelGetWithKeysResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChannelResponseList.DeserializeChannelResponseList(document.RootElement); + value = BotChannelGetWithKeysResult.DeserializeBotChannelGetWithKeysResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -609,28 +608,29 @@ 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. + /// Lists a Channel registration for a Bot Service including secrets. + /// The ID of the target subscription. + /// 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 ListByResourceGroup(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + public Response ListWithKeys(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListWithKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChannelResponseList value = default; + BotChannelGetWithKeysResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChannelResponseList.DeserializeChannelResponseList(document.RootElement); + value = BotChannelGetWithKeysResult.DeserializeBotChannelGetWithKeysResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -662,8 +662,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 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 +693,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 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 index 6d3a31bc46f1..495cff195c53 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/DirectLineRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/DirectLineRestOperations.cs @@ -32,7 +32,7 @@ public DirectLineRestOperations(HttpPipeline pipeline, string applicationId, Uri { _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); } @@ -81,8 +81,8 @@ internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string r } /// 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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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. @@ -113,8 +113,8 @@ public async Task> RegenerateKeysAsync(string subscript } /// 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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// 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. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs index e15d04ca7548..2d476b3f56c8 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs @@ -32,7 +32,7 @@ public EmailRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _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); } @@ -73,8 +73,8 @@ internal HttpMessage CreateCreateSignInUrlRequest(string subscriptionId, string } /// 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 ID of the target subscription. + /// 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. @@ -102,8 +102,8 @@ public async Task> CreateSignInUrlAsync( } /// 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 ID of the target subscription. + /// 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/HostSettingsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsRestOperations.cs index 86985a100647..d5aee7886406 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsRestOperations.cs @@ -32,7 +32,7 @@ public HostSettingsRestOperations(HttpPipeline pipeline, string applicationId, U { _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,7 +65,7 @@ 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 cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ 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 cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. 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..d7f8170ca918 --- /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. + /// server parameter. + /// Api Version. + /// 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 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 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 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 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 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 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 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 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 200: + case 202: + 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 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 200: + case 202: + 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 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 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/PrivateEndpointConnectionsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index bc6129bfae64..bc371275d2b5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _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); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all the private endpoint connections associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -102,8 +102,8 @@ public async Task> ListA } /// List all the private endpoint connections associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -169,8 +169,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -202,8 +202,8 @@ public async Task> GetAsync(st } /// Gets the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -277,8 +277,8 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// 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. + /// The ID of the target subscription. + /// 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. @@ -310,8 +310,8 @@ public async Task> CreateAsync } /// 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. + /// The ID of the target subscription. + /// 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. @@ -381,8 +381,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -408,8 +408,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. + /// 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. @@ -433,5 +433,89 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r 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 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 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 index ad5a8e6b076e..43a0c33a8d36 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _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); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListByBotResourceRequest(string subscriptionId, strin } /// 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 ID of the target subscription. + /// 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. @@ -102,8 +102,8 @@ public async Task> ListByBotRe } /// 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 ID of the target subscription. + /// 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/QnAMakerEndpointKeysRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysRestOperations.cs index c93157890eec..a0062d11e1bc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysRestOperations.cs @@ -32,7 +32,7 @@ public QnAMakerEndpointKeysRestOperations(HttpPipeline pipeline, string applicat { _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); } @@ -69,8 +69,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, GetBotServiceQnAMak } /// 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 request body. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -96,8 +96,8 @@ 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 request body. /// 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/autorest.md b/sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md index cf79fc6b2e29..70922a0b19ad 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md @@ -9,7 +9,7 @@ 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 +require: https://github.com/Azure/azure-rest-api-specs/blob/897f19441a4cc240eba138296f31e50841a6b57f/specification/botservice/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -108,11 +108,108 @@ rename-mapping: 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')] + where: $.parameters transform: > $ = { - "$ref": "#/parameters/channelNameParameter" + "channelNameParameter": { + "name": "channelName", + "x-ms-parameter-location": "method", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "AlexaChannel", + "FacebookChannel", + "EmailChannel", + "KikChannel", + "TelegramChannel", + "SlackChannel", + "MsTeamsChannel", + "SkypeChannel", + "WebChatChannel", + "DirectLineChannel", + "SmsChannel", + "LineChannel", + "DirectLineSpeechChannel", + "OutlookChannel", + "Omnichannel", + "TelephonyChannel", + "AcsChatChannel", + "SearchAssistant", + "M365Extensions" + ], + "x-ms-enum": { + "name": "channelName", + "modelAsString": false, + "values": [ + { + "value": "AlexaChannel" + }, + { + "value": "FacebookChannel" + }, + { + "value": "EmailChannel" + }, + { + "value": "KikChannel" + }, + { + "value": "TelegramChannel" + }, + { + "value": "SlackChannel" + }, + { + "value": "MsTeamsChannel" + }, + { + "value": "SkypeChannel" + }, + { + "value": "WebChatChannel" + }, + { + "value": "DirectLineChannel" + }, + { + "value": "SmsChannel" + }, + { + "value": "LineChannel" + }, + { + "value": "DirectLineSpeechChannel" + }, + { + "value": "OutlookChannel" + }, + { + "value": "Omnichannel" + }, + { + "value": "TelephonyChannel" + }, + { + "value": "AcsChatChannel" + }, + { + "value": "SearchAssistant" + }, + { + "value": "M365Extensions" + } + ] + }, + "description": "The name of the Channel resource." + } }; + - from: botservice.json + where: $.paths..parameters[?(@.name=='channelName' && (!@['x-ms-enum'] || @['x-ms-enum'].name!='RegenerateKeysChannelName'))] + transform: > + $ = { + "$ref": "#/parameters/channelNameParameter" + }; - from: botservice.json where: $.definitions transform: > @@ -121,5 +218,9 @@ directive: where: $.parameters transform: > $.channelNameParameter['x-ms-enum']['modelAsString'] = true; + - from: botservice.json + where: $.definitions + transform: > + $.PrivateLinkResourceProperties['properties']['requiredZoneNames']['readOnly'] = false; ``` diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelCollection.cs index b955034b5ce6..57fd9987854d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelCollection.cs @@ -20,7 +20,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -62,7 +62,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -107,7 +107,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -154,7 +154,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -200,7 +200,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -249,7 +249,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -283,7 +283,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -317,7 +317,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -351,7 +351,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -385,7 +385,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -421,7 +421,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -451,7 +451,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -481,7 +481,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -511,7 +511,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -541,7 +541,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -583,7 +583,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -625,7 +625,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -667,7 +667,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelResource.cs index 977516519f7c..23fba5f25dda 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotChannelResource.cs @@ -20,7 +20,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -51,7 +51,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -82,7 +82,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -113,7 +113,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -144,7 +144,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -171,7 +171,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -198,7 +198,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -236,7 +236,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -277,7 +277,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -320,7 +320,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -365,7 +365,7 @@ public async Task Update_UpdateLineChannel() [Ignore("Only validating compilation of examples")] public async Task GetChannelWithKeys_ListChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotCollection.cs index 10bc0f645329..b47e7dc77ffb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotCollection.cs @@ -21,7 +21,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -84,7 +84,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -117,7 +117,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -152,7 +152,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -181,7 +181,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingCollection.cs index 2b61729e928f..e55803b655b5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_BotConnectionSettingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/PutConnection.json // this example is just showing the usage of "BotConnection_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 @@ -75,7 +75,7 @@ public async Task CreateOrUpdate_CreateConnectionSetting() [Ignore("Only validating compilation of examples")] public async Task Get_GetConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetConnection.json // this example is just showing the usage of "BotConnection_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 @@ -109,7 +109,7 @@ public async Task Get_GetConnectionSetting() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListConnectionSettings() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListConnectionsByBotService.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/ListConnectionsByBotService.json // this example is just showing the usage of "BotConnection_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 @@ -145,7 +145,7 @@ public async Task GetAll_ListConnectionSettings() [Ignore("Only validating compilation of examples")] public async Task Exists_GetConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetConnection.json // this example is just showing the usage of "BotConnection_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 @@ -175,7 +175,7 @@ public async Task Exists_GetConnectionSetting() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetConnection.json // this example is just showing the usage of "BotConnection_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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingResource.cs index e33931188f27..999ca2de84bc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotConnectionSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_BotConnectionSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetConnection.json // this example is just showing the usage of "BotConnection_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 @@ -51,7 +51,7 @@ public async Task Get_GetConnectionSetting() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/DeleteConnection.json // this example is just showing the usage of "BotConnection_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 @@ -78,7 +78,7 @@ public async Task Delete_DeleteConnectionSetting() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateConnectionSetting() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/UpdateConnection.json // this example is just showing the usage of "BotConnection_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 @@ -100,6 +100,8 @@ public async Task Update_UpdateConnectionSetting() { Properties = new BotConnectionSettingProperties { + Id = "sampleId", + Name = "sampleName", ClientId = "sampleclientid", ClientSecret = "samplesecret", Scopes = "samplescope", @@ -130,7 +132,7 @@ public async Task Update_UpdateConnectionSetting() [Ignore("Only validating compilation of examples")] public async Task GetWithSecrets_ListConnectionSettingWithSecrets() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetConnection.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetConnectionListWithSecrets.json // this example is just showing the usage of "BotConnection_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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotResource.cs index 1432e581299b..865c5f0e8fc7 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotResource.cs @@ -20,7 +20,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -50,7 +50,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -76,7 +76,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -135,7 +135,7 @@ public async Task Update_UpdateBot() [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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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 @@ -167,7 +167,7 @@ public async Task GetBotChannelWithRegenerateKeys_RegenerateKeysForDirectLineCha [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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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 @@ -199,7 +199,7 @@ public async Task GetBotChannelWithRegenerateKeys_RegenerateKeysForWebChatChanne [Ignore("Only validating compilation of examples")] public async Task CreateEmailSignInUri_CreateUrl() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -225,7 +225,7 @@ public async Task CreateEmailSignInUri_CreateUrl() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResourcesByBotResource_ListPrivateLinkResources() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs index fb863af897c7..96d5ad523172 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -63,7 +63,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -97,7 +97,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -133,7 +133,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -163,7 +163,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs index 5b4f9901494d..31730bfa5849 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -51,7 +51,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -78,7 +78,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs new file mode 100644 index 000000000000..c075853b67a8 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/ListNetworkSecurityPerimeterConfigurations.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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/tests/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs new file mode 100644 index 000000000000..4e7d3e362247 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/examples/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/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index fba99f5674d0..abaa3585f81b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ 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 + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 @@ -50,10 +50,10 @@ public async Task GetBots_ListBotsBySubscription() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotConnectionServiceProviders_ListAuthServiceProviders() + public async Task GetBotServiceHostSettings_GetBotHostSettings() { - // 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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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(); @@ -66,21 +66,18 @@ public async Task GetBotConnectionServiceProviders_ListAuthServiceProviders() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation and iterate over the result - await foreach (BotServiceProvider item in subscriptionResource.GetBotConnectionServiceProvidersAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } + // invoke the operation + BotServiceHostSettingsResult result = await subscriptionResource.GetBotServiceHostSettingsAsync(); - Console.WriteLine("Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotServiceQnAMakerEndpointKey_ListQnAMakerEndpointKeys() + public async Task GetBotConnectionServiceProviders_ListAuthServiceProviders() { - // 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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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,23 +90,21 @@ public async Task GetBotServiceQnAMakerEndpointKey_ListQnAMakerEndpointKeys() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation - GetBotServiceQnAMakerEndpointKeyContent content = new GetBotServiceQnAMakerEndpointKeyContent + // invoke the operation and iterate over the result + await foreach (BotServiceProvider item in subscriptionResource.GetBotConnectionServiceProvidersAsync()) { - Hostname = "https://xxx.cognitiveservices.azure.com/", - Authkey = "testAuthKey", - }; - GetBotServiceQnAMakerEndpointKeyResult result = await subscriptionResource.GetBotServiceQnAMakerEndpointKeyAsync(content); + Console.WriteLine($"Succeeded: {item}"); + } - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine("Succeeded"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotServiceHostSettings_GetBotHostSettings() + public async Task GetBotServiceQnAMakerEndpointKey_ListQnAMakerEndpointKeys() { - // 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: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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 +118,12 @@ public async Task GetBotServiceHostSettings_GetBotHostSettings() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - BotServiceHostSettingsResult result = await subscriptionResource.GetBotServiceHostSettingsAsync(); + GetBotServiceQnAMakerEndpointKeyContent content = new GetBotServiceQnAMakerEndpointKeyContent + { + Hostname = "https://xxx.cognitiveservices.azure.com/", + Authkey = "testAuthKey", + }; + GetBotServiceQnAMakerEndpointKeyResult result = await subscriptionResource.GetBotServiceQnAMakerEndpointKeyAsync(content); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_TenantResourceExtensions.cs index 5c443b382323..5ef46cac2c4b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_TenantResourceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/tests/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_TenantResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckBotServiceNameAvailability_CheckNameAvailability() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json + // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/preview/2023-09-15-preview/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. // 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