-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
armresourcegraph v0.8.0 release (#21007)
- Loading branch information
1 parent
e75e708
commit 19c14fc
Showing
21 changed files
with
616 additions
and
64 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
sdk/resourcemanager/resourcegraph/armresourcegraph/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,31 @@ A client groups a set of related APIs, providing access to its functionality. C | |
client := clientFactory.NewClient() | ||
``` | ||
|
||
## Fakes | ||
The `fake` package provides implementations for fake servers that can be used for testing. | ||
To create a fake server, declare an instance of the required fake server type(s). | ||
```go | ||
myFakeServer := fake.Server{} | ||
``` | ||
Next, provide func implementations for the methods you wish to fake. | ||
The named return variables can be used to simplify return value construction. | ||
```go | ||
myFakeServer.Resources = func(ctx context.Context, query armresourcegraph.QueryRequest, options *armresourcegraph.ClientResourcesOptions) (resp azfake.Responder[armresourcegraph.ClientResourcesResponse], errResp azfake.ErrorResponder) { | ||
// TODO: resp.SetResponse(/* your fake ClientResourcesResponse response */) | ||
return | ||
} | ||
``` | ||
You connect the fake server to a client instance during construction through the optional transport. | ||
Use `NewTokenCredential()` from `azcore/fake` to obtain a fake credential. | ||
```go | ||
import azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" | ||
client, err := armresourcegraph.NewClient("subscriptionID", azfake.NewTokenCredential(), &arm.ClientOptions{ | ||
ClientOptions: azcore.ClientOptions{ | ||
Transport: fake.NewServerTransport(&myFakeServer), | ||
}, | ||
}) | ||
``` | ||
|
||
## Provide Feedback | ||
|
||
If you encounter bugs or have suggestions, please | ||
|
@@ -82,4 +107,4 @@ This project has adopted the | |
For more information, see the | ||
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) | ||
or contact [[email protected]](mailto:[email protected]) with any | ||
additional questions or comments. | ||
additional questions or comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
// This file enables 'go generate' to regenerate this specific SDK | ||
//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/resourcegraph/armresourcegraph | ||
//go:generate pwsh ../../../../eng/scripts/build.ps1 -goExtension "@autorest/[email protected]" -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/resourcegraph/armresourcegraph | ||
|
||
package armresourcegraph |
43 changes: 31 additions & 12 deletions
43
sdk/resourcemanager/resourcegraph/armresourcegraph/client.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 1 addition & 2 deletions
3
sdk/resourcemanager/resourcegraph/armresourcegraph/client_factory.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
33 changes: 16 additions & 17 deletions
33
sdk/resourcemanager/resourcegraph/armresourcegraph/constants.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
sdk/resourcemanager/resourcegraph/armresourcegraph/fake/internal.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.