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
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.

using System.Linq;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@dragonfly91 this file needs a license header

using System.Net.Http;
using Microsoft.Rest;
using Microsoft.Rest.Serialization;

namespace Microsoft.Azure.Management.RecoveryServices
{
public partial class RecoveryServicesClient
{
bool DisableDispose { get; set; }

protected RecoveryServicesClient(HttpClient httpClient, params DelegatingHandler[] handlers)
{
InitializeHttpClient(httpClient, null, handlers);
Initialize();
}

public RecoveryServicesClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClient httpClient, bool disableDispose, params DelegatingHandler[] handlers)
: this(httpClient, handlers)
{
if (baseUri == null)
{
throw new System.ArgumentNullException("baseUri");
}
if (credentials == null)
{
throw new System.ArgumentNullException("credentials");
}
BaseUri = baseUri;
Credentials = credentials;
if (Credentials != null)
{
Credentials.InitializeServiceClient(this);
}
DisableDispose = disableDispose;
}

protected override void Dispose(bool disposing)
{
if (DisableDispose)
{
base.Dispose(disposing);
}
}

partial void CustomInitialize()
{
var iso8601TimeSpanConverter = DeserializationSettings.Converters.First(conv => conv is Iso8601TimeSpanConverter);
if (iso8601TimeSpanConverter != null)
{
DeserializationSettings.Converters.Remove(iso8601TimeSpanConverter);
}
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

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

/// <summary>
/// Extension methods for BackupStorageConfigsOperations.
/// </summary>
public static partial class BackupStorageConfigsOperationsExtensions
{
/// <summary>
/// Fetches resource storage config.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// </param>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
public static BackupStorageConfig Get(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName)
{
return operations.GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult();
}

/// <summary>
/// Fetches resource storage config.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// </param>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<BackupStorageConfig> GetAsync(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// Updates vault storage model type.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// </param>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
/// <param name='backupStorageConfig'>
/// Backup storage config.
/// </param>
public static void Update(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName, BackupStorageConfig backupStorageConfig)
{
operations.UpdateAsync(resourceGroupName, vaultName, backupStorageConfig).GetAwaiter().GetResult();
}

/// <summary>
/// Updates vault storage model type.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// </param>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
/// <param name='backupStorageConfig'>
/// Backup storage config.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task UpdateAsync(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName, BackupStorageConfig backupStorageConfig, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, backupStorageConfig, null, cancellationToken).ConfigureAwait(false)).Dispose();
}

}
}
Loading