// 
// Copyright (c) Microsoft and contributors.  All rights reserved.
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// 
// See the License for the specific language governing permissions and
// limitations under the License.
// 

// Warning: This code was generated by a tool.
// 
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Management.Sql.Models;

namespace Microsoft.WindowsAzure.Management.Sql
{
    /// <summary>
    /// The Azure SQL Database Management API includes operations for managing
    /// the server-level Firewall Rules for Azure SQL Database Servers. You
    /// cannot manage the database-level firewall rules using the Azure SQL
    /// Database Management API; they can only be managed by running the
    /// Transact-SQL statements against the master or individual user
    /// databases.
    /// </summary>
    public partial interface IFirewallRuleOperations
    {
        /// <summary>
        /// Adds a new server-level Firewall Rule for an Azure SQL Database
        /// Server.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server to which this rule will
        /// be applied.
        /// </param>
        /// <param name='parameters'>
        /// The parameters for the Create Firewall Rule operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains the response to a Create Firewall Rule operation.
        /// </returns>
        Task<FirewallRuleCreateResponse> CreateAsync(string serverName, FirewallRuleCreateParameters parameters, CancellationToken cancellationToken);
        
        /// <summary>
        /// Deletes a server-level Firewall Rule from an Azure SQL Database
        /// Server.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server that will have the
        /// Firewall Fule removed from it.
        /// </param>
        /// <param name='ruleName'>
        /// The name of the Firewall Fule to delete.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        Task<OperationResponse> DeleteAsync(string serverName, string ruleName, CancellationToken cancellationToken);
        
        /// <summary>
        /// Returns the Firewall rule for an Azure SQL Database Server with a
        /// matching name.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server to query for the Firewall
        /// Rule.
        /// </param>
        /// <param name='ruleName'>
        /// The name of the rule to retrieve.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains the response from a request to Get Firewall Rule.
        /// </returns>
        Task<FirewallRuleGetResponse> GetAsync(string serverName, string ruleName, CancellationToken cancellationToken);
        
        /// <summary>
        /// Returns a list of server-level Firewall Rules for an Azure SQL
        /// Database Server.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server from which to list the
        /// Firewall Rules.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Contains the response from a request to List Firewall Rules.
        /// </returns>
        Task<FirewallRuleListResponse> ListAsync(string serverName, CancellationToken cancellationToken);
        
        /// <summary>
        /// Updates an existing server-level Firewall Rule for an Azure SQL
        /// Database Server.
        /// </summary>
        /// <param name='serverName'>
        /// The name of the Azure SQL Database Server that has the Firewall
        /// Rule to be updated.
        /// </param>
        /// <param name='ruleName'>
        /// The name of the Firewall Rule to be updated.
        /// </param>
        /// <param name='parameters'>
        /// The parameters for the Update Firewall Rule operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// Represents the firewall rule update response.
        /// </returns>
        Task<FirewallRuleUpdateResponse> UpdateAsync(string serverName, string ruleName, FirewallRuleUpdateParameters parameters, CancellationToken cancellationToken);
    }
}
