Skip to content

Commit

Permalink
Various renaming for x-language consistency (Azure#17320)
Browse files Browse the repository at this point in the history
* Various renaming for x-language consistency
  • Loading branch information
christothes authored and annelo-msft committed Feb 17, 2021
1 parent ff1fc72 commit ac4ae82
Show file tree
Hide file tree
Showing 16 changed files with 424 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public BackupOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClie
public partial class BackupResult
{
internal BackupResult() { }
public System.Uri BackupFolderUri { get { throw null; } }
public System.DateTimeOffset EndTime { get { throw null; } }
public System.Uri FolderUri { get { throw null; } }
public System.DateTimeOffset StartTime { get { throw null; } }
}
public partial class KeyVaultAccessControlClient
Expand Down Expand Up @@ -51,11 +51,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 +66,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 @@ -145,4 +146,25 @@ 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
{
internal SelectiveKeyRestoreResult() { }
public System.DateTimeOffset EndTime { get { throw null; } }
public System.DateTimeOffset StartTime { get { throw null; } }
}
}
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
Expand Up @@ -11,18 +11,19 @@ namespace Azure.Security.KeyVault.Administration
/// </summary>
public class BackupResult
{
internal BackupResult(Uri backupFolderUri, DateTimeOffset startTime, DateTimeOffset endTime)
internal BackupResult(Uri folderUri, DateTimeOffset startTime, DateTimeOffset endTime)
{
Argument.AssertNotNull(backupFolderUri, nameof(backupFolderUri));
Argument.AssertNotNull(folderUri, nameof(folderUri));

this.BackupFolderUri = backupFolderUri;
FolderUri = folderUri;
StartTime = startTime;
EndTime = endTime;
}

/// <summary>
/// Gets the location of the full backup.
/// </summary>
public Uri BackupFolderUri { get; }
public Uri FolderUri { get; }

/// <summary>
/// Gets the start time of the backup operation.
Expand Down
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

0 comments on commit ac4ae82

Please sign in to comment.