Skip to content
Closed
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,313 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.Management.CosmosDBForPostgreSql
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// Extension methods for FirewallRulesOperations.
/// </summary>
public static partial class FirewallRulesOperationsExtensions
{
/// <summary>
/// Creates a new cluster firewall rule or updates an existing cluster firewall
/// rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='parameters'>
/// The required parameters for creating or updating a firewall rule.
/// </param>
public static FirewallRule CreateOrUpdate(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, FirewallRule parameters)
{
return operations.CreateOrUpdateAsync(resourceGroupName, clusterName, firewallRuleName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// Creates a new cluster firewall rule or updates an existing cluster firewall
/// rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='parameters'>
/// The required parameters for creating or updating a firewall rule.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<FirewallRule> CreateOrUpdateAsync(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Deletes a cluster firewall rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
public static FirewallRulesDeleteHeaders Delete(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName)
{
return operations.DeleteAsync(resourceGroupName, clusterName, firewallRuleName).GetAwaiter().GetResult();
}

/// <summary>
/// Deletes a cluster firewall rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<FirewallRulesDeleteHeaders> DeleteAsync(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, firewallRuleName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Headers;
}
}

/// <summary>
/// Gets information about a cluster firewall rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
public static FirewallRule Get(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName)
{
return operations.GetAsync(resourceGroupName, clusterName, firewallRuleName).GetAwaiter().GetResult();
}

/// <summary>
/// Gets information about a cluster firewall rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<FirewallRule> GetAsync(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, firewallRuleName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Lists all the firewall rules on cluster.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
public static IEnumerable<FirewallRule> ListByCluster(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName)
{
return operations.ListByClusterAsync(resourceGroupName, clusterName).GetAwaiter().GetResult();
}

/// <summary>
/// Lists all the firewall rules on cluster.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IEnumerable<FirewallRule>> ListByClusterAsync(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByClusterWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Creates a new cluster firewall rule or updates an existing cluster firewall
/// rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='parameters'>
/// The required parameters for creating or updating a firewall rule.
/// </param>
public static FirewallRule BeginCreateOrUpdate(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, FirewallRule parameters)
{
return operations.BeginCreateOrUpdateAsync(resourceGroupName, clusterName, firewallRuleName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// Creates a new cluster firewall rule or updates an existing cluster firewall
/// rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='parameters'>
/// The required parameters for creating or updating a firewall rule.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<FirewallRule> BeginCreateOrUpdateAsync(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, FirewallRule parameters, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, firewallRuleName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Deletes a cluster firewall rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
public static FirewallRulesDeleteHeaders BeginDelete(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName)
{
return operations.BeginDeleteAsync(resourceGroupName, clusterName, firewallRuleName).GetAwaiter().GetResult();
}

/// <summary>
/// Deletes a cluster firewall rule.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='clusterName'>
/// The name of the cluster.
/// </param>
/// <param name='firewallRuleName'>
/// The name of the cluster firewall rule.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<FirewallRulesDeleteHeaders> BeginDeleteAsync(this IFirewallRulesOperations operations, string resourceGroupName, string clusterName, string firewallRuleName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, firewallRuleName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Headers;
}
}

}
}
Loading