Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions eng/mgmt/mgmtmetadata/sql_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\azure-sdk-for-net\sdk
2021-05-07 22:38:44 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/sql/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\azure-sdk-for-net\sdk
Autorest CSharp Version: 2.3.82
2021-05-13 18:14:30 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: a4924d479f80242b6bd5d02328c4579f58dc87da
Commit: 7d4caa5e1c9996a25300b0b23ef426667e4a7bde
AutoRest information
Requested version: v2
Bootstrapper version: [email protected]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>Sql_2017-10-01-preview;Sql_2020-08-01-preview;Sql_2014-04-01;Sql_2015-05-01-preview;Sql_2017-03-01-preview;Sql_2020-02-02-preview;Sql_2020-11-01-preview;Sql_2018-06-01-preview;Sql_2019-06-01-preview;</AzureApiTag>
<AzureApiTag>Sql_2020-11-01-preview;Sql_2014-04-01;Sql_2021-02-01-preview;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace Microsoft.Azure.Management.Sql
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -61,5 +63,50 @@ public async Task<AzureOperationResponse> RenameWithHttpMessagesAsync(
customHeaders,
cancellationToken).ConfigureAwait(false);
}

Copy link
Member

@markcowl markcowl May 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly looks good. To completely disambiguate the method calls, the customeHeadres parameter should not have a default value - this way, any call that uses 2 string parameters will go to the new method , you would need similar customizations in the partial interface for IDatabasesOperations and the ListByServerAsync method in the DatabasesOperationsExtensions partial class [although, since this is an extension method, it doden't need to reside in the same static class]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I understand now. Made the changes to add the interface in IDatabasesOperations, and add ListByServerAsync without skip token in the DatabasesOperationsExtensions class

/// <summary>
/// Gets a list of databases.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='serverName'>
/// The name of the server.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<IPage<Database>>> ListByServerWithHttpMessagesAsync(
string resourceGroupName,
string serverName,
Dictionary<string, List<string>> customHeaders,
CancellationToken cancellationToken = default(CancellationToken))
{
return await this.ListByServerWithHttpMessagesAsync(
resourceGroupName,
serverName,
null,
customHeaders,
cancellationToken).ConfigureAwait(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Microsoft.Azure.Management.Sql
{
using Microsoft.Rest.Azure;
using Models;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -76,5 +78,29 @@ public static async Task RenameAsync(
null,
cancellationToken).ConfigureAwait(false)).Dispose();
}

/// <summary>
/// Gets a list of databases.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='serverName'>
/// The name of the server.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<Database>> ListByServerAsync(this IDatabasesOperations operations, string resourceGroupName, string serverName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByServerWithHttpMessagesAsync(resourceGroupName, serverName, null, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace Microsoft.Azure.Management.Sql
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -47,5 +49,42 @@ Task<AzureOperationResponse> RenameWithHttpMessagesAsync(
string newName,
Dictionary<string, List<string>> customHeaders = null,
CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
/// Gets a list of databases.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can obtain
/// this value from the Azure Resource Manager API or the portal.
/// </param>
/// <param name='serverName'>
/// The name of the server.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="SerializationException">
/// Thrown when unable to deserialize the responseListByServerWithHttpMessagesAsync
/// </exception>
/// <exception cref="ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
Task<AzureOperationResponse<IPage<Database>>> ListByServerWithHttpMessagesAsync(
string resourceGroupName,
string serverName,
Dictionary<string, List<string>> customHeaders,
CancellationToken cancellationToken = default(CancellationToken));
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading