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

[azadmin] convert to typespec #23906

Merged
merged 5 commits into from
Jan 16, 2025
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
103 changes: 0 additions & 103 deletions sdk/security/keyvault/azadmin/backup/autorest.md

This file was deleted.

41 changes: 22 additions & 19 deletions sdk/security/keyvault/azadmin/backup/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions sdk/security/keyvault/azadmin/backup/client_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Licensed under the MIT License. See License.txt in the project root for license information.

package backup_test

Expand Down
21 changes: 13 additions & 8 deletions sdk/security/keyvault/azadmin/backup/custom_client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

Expand Down Expand Up @@ -56,7 +53,7 @@ func NewClient(vaultURL string, credential azcore.TokenCredential, options *Clie
if err != nil {
return nil, err
}
return &Client{endpoint: vaultURL, internal: azcoreClient}, nil
return &Client{vaultBaseUrl: vaultURL, internal: azcoreClient}, nil
}

// ErrorInfo - Internal error from Azure Key Vault server.
Expand Down Expand Up @@ -98,17 +95,21 @@ func (client *Client) beginFullRestore(ctx context.Context, restoreBlobDetails R
if err != nil {
return nil, err
}
return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FullRestoreResponse]{
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FullRestoreResponse]{
FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
Handler: handler,
Tracer: client.internal.Tracer(),
})
return poller, err
} else {
handler, err := pollers.NewRestorePoller[FullRestoreResponse](client.internal.Pipeline(), nil, runtime.FinalStateViaAzureAsyncOp)
if err != nil {
return nil, err
}
return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FullRestoreResponse]{Handler: handler})
return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[FullRestoreResponse]{
Handler: handler,
Tracer: client.internal.Tracer(),
})
}
}

Expand All @@ -124,16 +125,20 @@ func (client *Client) beginSelectiveKeyRestore(ctx context.Context, keyName stri
if err != nil {
return nil, err
}
return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SelectiveKeyRestoreResponse]{
poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SelectiveKeyRestoreResponse]{
FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
Handler: handler,
Tracer: client.internal.Tracer(),
})
return poller, err
} else {
handler, err := pollers.NewRestorePoller[SelectiveKeyRestoreResponse](client.internal.Pipeline(), nil, runtime.FinalStateViaAzureAsyncOp)
if err != nil {
return nil, err
}
return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SelectiveKeyRestoreResponse]{Handler: handler})
return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SelectiveKeyRestoreResponse]{
Handler: handler,
Tracer: client.internal.Tracer(),
})
}
}
2 changes: 1 addition & 1 deletion sdk/security/keyvault/azadmin/backup/example_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Licensed under the MIT License. See License.txt in the project root for license information.

package backup_test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

Expand Down
19 changes: 7 additions & 12 deletions sdk/security/keyvault/azadmin/backup/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions sdk/security/keyvault/azadmin/backup/models_serde.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading