Skip to content
Open
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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
// <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.SoftwarePlan
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// Extension methods for HybridUseBenefitOperations.
/// </summary>
public static partial class HybridUseBenefitOperationsExtensions
{
/// <summary>
/// Get all hybrid use benefits associated with an ARM resource.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='filter'>
/// Supports applying filter on the type of SKU
/// </param>
public static IPage<HybridUseBenefitModel> List(this IHybridUseBenefitOperations operations, string scope, string filter = default(string))
{
return operations.ListAsync(scope, filter).GetAwaiter().GetResult();
}

/// <summary>
/// Get all hybrid use benefits associated with an ARM resource.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='filter'>
/// Supports applying filter on the type of SKU
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<HybridUseBenefitModel>> ListAsync(this IHybridUseBenefitOperations operations, string scope, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(scope, filter, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Create a new hybrid use benefit under a given scope
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
/// <param name='sku'>
/// Hybrid use benefit SKU
/// </param>
public static HybridUseBenefitModel Create(this IHybridUseBenefitOperations operations, string scope, string planId, Sku sku)
{
return operations.CreateAsync(scope, planId, sku).GetAwaiter().GetResult();
}

/// <summary>
/// Create a new hybrid use benefit under a given scope
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
/// <param name='sku'>
/// Hybrid use benefit SKU
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<HybridUseBenefitModel> CreateAsync(this IHybridUseBenefitOperations operations, string scope, string planId, Sku sku, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateWithHttpMessagesAsync(scope, planId, sku, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Updates an existing hybrid use benefit
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
/// <param name='sku'>
/// Hybrid use benefit SKU
/// </param>
public static HybridUseBenefitModel Update(this IHybridUseBenefitOperations operations, string scope, string planId, Sku sku)
{
return operations.UpdateAsync(scope, planId, sku).GetAwaiter().GetResult();
}

/// <summary>
/// Updates an existing hybrid use benefit
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
/// <param name='sku'>
/// Hybrid use benefit SKU
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<HybridUseBenefitModel> UpdateAsync(this IHybridUseBenefitOperations operations, string scope, string planId, Sku sku, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.UpdateWithHttpMessagesAsync(scope, planId, sku, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Gets a given plan ID
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
public static HybridUseBenefitModel Get(this IHybridUseBenefitOperations operations, string scope, string planId)
{
return operations.GetAsync(scope, planId).GetAwaiter().GetResult();
}

/// <summary>
/// Gets a given plan ID
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<HybridUseBenefitModel> GetAsync(this IHybridUseBenefitOperations operations, string scope, string planId, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(scope, planId, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Deletes a given plan ID
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
public static void Delete(this IHybridUseBenefitOperations operations, string scope, string planId)
{
operations.DeleteAsync(scope, planId).GetAwaiter().GetResult();
}

/// <summary>
/// Deletes a given plan ID
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope at which the operation is performed. This is limited to
/// Microsoft.Compute/virtualMachines and Microsoft.Compute/hostGroups/hosts
/// for now
/// </param>
/// <param name='planId'>
/// This is a unique identifier for a plan. Should be a guid.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this IHybridUseBenefitOperations operations, string scope, string planId, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.DeleteWithHttpMessagesAsync(scope, planId, null, cancellationToken).ConfigureAwait(false)).Dispose();
}

/// <summary>
/// Get all hybrid use benefits associated with an ARM resource.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<HybridUseBenefitModel> ListNext(this IHybridUseBenefitOperations operations, string nextPageLink)
{
return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
}

/// <summary>
/// Get all hybrid use benefits associated with an ARM resource.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<HybridUseBenefitModel>> ListNextAsync(this IHybridUseBenefitOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

}
}
Loading