Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various renaming for x-language consistency #17320

Merged
merged 3 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -15,13 +15,17 @@ public BackupOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClie
public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Security.KeyVault.Administration.BackupResult>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Security.KeyVault.Administration.BackupResult>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class BackupResult
public abstract partial class BackupRestoreResult
christothes marked this conversation as resolved.
Show resolved Hide resolved
{
internal BackupResult() { }
public System.Uri BackupFolderUri { get { throw null; } }
internal BackupRestoreResult() { }
public System.DateTimeOffset EndTime { get { throw null; } }
public System.DateTimeOffset StartTime { get { throw null; } }
}
public partial class BackupResult : Azure.Security.KeyVault.Administration.BackupRestoreResult
{
internal BackupResult() { }
public System.Uri folderUri { get { throw null; } }
christothes marked this conversation as resolved.
Show resolved Hide resolved
}
public partial class KeyVaultAccessControlClient
{
protected KeyVaultAccessControlClient() { }
Expand Down Expand Up @@ -51,11 +55,12 @@ public enum ServiceVersion
public static partial class KeyVaultAdministrationModelFactory
{
public static Azure.Security.KeyVault.Administration.BackupOperation BackupOperation(Azure.Response response, Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id, System.Uri blobContainerUri, System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), string errorMessage = null) { throw null; }
public static Azure.Security.KeyVault.Administration.BackupResult BackupResult(System.Uri backupFolderUri, System.DateTimeOffset startTime, System.DateTimeOffset endTime) { throw null; }
public static Azure.Security.KeyVault.Administration.BackupResult BackupResult(System.Uri folderUri, System.DateTimeOffset startTime, System.DateTimeOffset endTime) { throw null; }
public static Azure.Security.KeyVault.Administration.RestoreOperation RestoreOperation(Azure.Response response, Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id, System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), string errorMessage = null) { throw null; }
public static Azure.Security.KeyVault.Administration.RestoreResult RestoreResult(System.DateTimeOffset startTime, System.DateTimeOffset endTime) { throw null; }
public static Azure.Security.KeyVault.Administration.KeyVaultRoleAssignment RoleAssignment(string id, string name, string type, Azure.Security.KeyVault.Administration.KeyVaultRoleAssignmentPropertiesWithScope properties) { throw null; }
public static Azure.Security.KeyVault.Administration.KeyVaultRoleDefinition RoleDefinition(string id, string name, string type, string roleName, string description, string roleType, System.Collections.Generic.IList<Azure.Security.KeyVault.Administration.KeyVaultPermission> permissions, System.Collections.Generic.IList<string> assignableScopes) { throw null; }
public static Azure.Security.KeyVault.Administration.RestoreResult SelectiveKeyRestoreResult(System.DateTimeOffset startTime, System.DateTimeOffset endTime) { throw null; }
}
public partial class KeyVaultBackupClient
{
Expand All @@ -65,10 +70,10 @@ public KeyVaultBackupClient(System.Uri vaultUri, Azure.Core.TokenCredential cred
public virtual System.Uri VaultUri { get { throw null; } }
public virtual Azure.Security.KeyVault.Administration.BackupOperation StartBackup(System.Uri blobStorageUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Administration.BackupOperation> StartBackupAsync(System.Uri blobStorageUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Security.KeyVault.Administration.RestoreOperation StartRestore(System.Uri backupFolderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Administration.RestoreOperation> StartRestoreAsync(System.Uri backupFolderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Security.KeyVault.Administration.RestoreOperation StartSelectiveRestore(string keyName, System.Uri backupFolderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Administration.RestoreOperation> StartSelectiveRestoreAsync(string keyName, System.Uri backupFolderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Security.KeyVault.Administration.RestoreOperation StartRestore(System.Uri folderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Administration.RestoreOperation> StartRestoreAsync(System.Uri folderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Security.KeyVault.Administration.SelectiveKeyRestoreOperation StartSelectiveRestore(string keyName, System.Uri folderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Administration.SelectiveKeyRestoreOperation> StartSelectiveRestoreAsync(string keyName, System.Uri folderUri, string sasToken, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class KeyVaultPermission
{
Expand Down Expand Up @@ -139,10 +144,27 @@ public RestoreOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupCli
public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Security.KeyVault.Administration.RestoreResult>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Security.KeyVault.Administration.RestoreResult>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class RestoreResult
public partial class RestoreResult : Azure.Security.KeyVault.Administration.BackupRestoreResult
{
internal RestoreResult() { }
public System.DateTimeOffset EndTime { get { throw null; } }
public System.DateTimeOffset StartTime { get { throw null; } }
}
public partial class SelectiveKeyRestoreOperation : Azure.Operation<Azure.Security.KeyVault.Administration.SelectiveKeyRestoreResult>
{
public SelectiveKeyRestoreOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id) { }
public System.DateTimeOffset? EndTime { get { throw null; } }
public override bool HasCompleted { get { throw null; } }
public override bool HasValue { get { throw null; } }
public override string Id { get { throw null; } }
public System.DateTimeOffset? StartTime { get { throw null; } }
public override Azure.Security.KeyVault.Administration.SelectiveKeyRestoreResult Value { get { throw null; } }
public override Azure.Response GetRawResponse() { throw null; }
public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.ValueTask<Azure.Response> UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Security.KeyVault.Administration.SelectiveKeyRestoreResult>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Security.KeyVault.Administration.SelectiveKeyRestoreResult>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class SelectiveKeyRestoreResult : Azure.Security.KeyVault.Administration.BackupRestoreResult
{
internal SelectiveKeyRestoreResult() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BackupOperation backupOperation = await Client.StartBackupAsync(builder.Uri, sas
Response<BackupResult> backupResult = await backupOperation.WaitForCompletionAsync();

// Get the Uri for the location of you backup blob.
Uri backupFolderUri = backupResult.Value.BackupFolderUri;
Uri folderUri = backupResult.Value.folderUri;
```

## Performing a full key restore
Expand All @@ -50,7 +50,7 @@ Alternatively, it is possible to [generate a SAS token in Storage Explorer](http

```C# Snippet:HelloFullRestoreAsync
// Start the restore using the backupBlobUri returned from a previous BackupOperation.
RestoreOperation restoreOperation = await Client.StartRestoreAsync(backupFolderUri, sasToken);
RestoreOperation restoreOperation = await Client.StartRestoreAsync(folderUri, sasToken);

// Wait for completion of the RestoreOperation.
Response<RestoreResult> restoreResult = await restoreOperation.WaitForCompletionAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ while (!backupOperation.HasCompleted)
}

// Get the Uri for the location of you backup blob.
Uri backupFolderUri = backupOperation.Value.BackupFolderUri;
Uri folderUri = backupOperation.Value.folderUri;
```

## Performing a full key restore
Expand All @@ -54,15 +54,15 @@ Alternatively, it is possible to [generate a SAS token in Storage Explorer](http

```C# Snippet:HelloFullRestoreSync
// Start the restore using the backupBlobUri returned from a previous BackupOperation.
RestoreOperation restoreOperation = Client.StartRestore(backupFolderUri, sasToken);
RestoreOperation restoreOperation = Client.StartRestore(folderUri, sasToken);

// Wait for completion of the RestoreOperation.
while (!restoreOperation.HasCompleted)
{
restoreOperation.UpdateStatus();
Thread.Sleep(3000);
}
Uri restoreResult = backupOperation.Value.BackupFolderUri;
Uri restoreResult = backupOperation.Value.folderUri;
```

<!-- LINKS -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Alternatively, it is possible to [generate a SAS token in Storage Explorer](http
string keyName = "<key name to restore>";

// Start the restore for a specific key that was previously backed up using the backupBlobUri returned from a previous BackupOperation.
RestoreOperation restoreOperation = await Client.StartSelectiveRestoreAsync(keyName, backupFolderUri, sasToken);
SelectiveKeyRestoreOperation restoreOperation = await Client.StartSelectiveRestoreAsync(keyName, folderUri, sasToken);

// Wait for completion of the RestoreOperation.
RestoreResult restoreResult = await restoreOperation.WaitForCompletionAsync();
SelectiveKeyRestoreResult restoreResult = await restoreOperation.WaitForCompletionAsync();
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BackupOperation backupOperation = new BackupOperation(client, backupOperationId)
Response<BackupResult> backupResult = await backupOperation.WaitForCompletionAsync();

// Get the Uri for the location of you backup blob.
Uri backupFolderUri = backupResult.Value.BackupFolderUri;
Uri folderUri = backupResult.Value.folderUri;
```

## Checking status of a full key restore operation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Azure.Core;

namespace Azure.Security.KeyVault.Administration
{
/// <summary>
/// The result of a backup or restore operation.
/// </summary>
public abstract class BackupRestoreResult
christothes marked this conversation as resolved.
Show resolved Hide resolved
{
internal BackupRestoreResult(DateTimeOffset startTime, DateTimeOffset endTime)
{
StartTime = startTime;
EndTime = endTime;
}

/// <summary>
/// Gets the start time of the backup operation.
/// </summary>
public DateTimeOffset StartTime { get; }

/// <summary>
/// Gets the end time of the backup operation.
/// </summary>
public DateTimeOffset EndTime { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,18 @@ namespace Azure.Security.KeyVault.Administration
/// <summary>
/// The result of a backup operation.
/// </summary>
public class BackupResult
public class BackupResult : BackupRestoreResult
{
internal BackupResult(Uri backupFolderUri, DateTimeOffset startTime, DateTimeOffset endTime)
internal BackupResult(Uri folderUri, DateTimeOffset startTime, DateTimeOffset endTime) : base(startTime, endTime)
{
Argument.AssertNotNull(backupFolderUri, nameof(backupFolderUri));
Argument.AssertNotNull(folderUri, nameof(folderUri));

this.BackupFolderUri = backupFolderUri;
StartTime = startTime;
EndTime = endTime;
this.folderUri = folderUri;
}
/// <summary>
/// Gets the location of the full backup.
/// </summary>
public Uri BackupFolderUri { get; }

/// <summary>
/// Gets the start time of the backup operation.
/// </summary>
public DateTimeOffset StartTime { get; }

/// <summary>
/// Gets the end time of the backup operation.
/// Gets the location of the full backup.
/// </summary>
public DateTimeOffset EndTime { get; }
public Uri folderUri { get; }
christothes marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public static BackupOperation BackupOperation(Response response, KeyVaultBackupC
/// <summary>
/// Initializes a new instance of a <see cref="BackupResult"/> for mocking purposes.
/// </summary>
/// <param name="backupFolderUri">The location of the backup.</param>
/// <param name="folderUri">The location of the backup.</param>
/// <param name="startTime">The start time of the backup operation.</param>
/// <param name="endTime">The end time of the backup operation.</param>
/// <returns>A new <see cref="BackupResult"/> instance.</returns>
public static BackupResult BackupResult(Uri backupFolderUri, DateTimeOffset startTime, DateTimeOffset endTime) =>
new BackupResult(backupFolderUri, startTime, endTime);
public static BackupResult BackupResult(Uri folderUri, DateTimeOffset startTime, DateTimeOffset endTime) =>
new BackupResult(folderUri, startTime, endTime);


/// <summary>
Expand All @@ -93,5 +93,14 @@ public static BackupResult BackupResult(Uri backupFolderUri, DateTimeOffset star
/// <returns>A new <see cref="BackupResult"/> instance.</returns>
public static RestoreResult RestoreResult(DateTimeOffset startTime, DateTimeOffset endTime) =>
new RestoreResult(startTime, endTime);

/// <summary>
/// Initializes a new instance of a <see cref="SelectiveKeyRestoreResult"/> for mocking purposes.
/// </summary>
/// <param name="startTime">The start time of the restore operation.</param>
/// <param name="endTime">The end time of the restore operation.</param>
/// <returns>A new <see cref="BackupResult"/> instance.</returns>
public static RestoreResult SelectiveKeyRestoreResult(DateTimeOffset startTime, DateTimeOffset endTime) =>
new RestoreResult(startTime, endTime);
}
}
Loading