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

armresourcegraph v0.8.0 release #21007

Merged
merged 1 commit into from
Jun 13, 2023
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
@@ -1,5 +1,11 @@
# Release History

## 0.8.0 (2023-06-13)

### Features Added

- Support for test fakes and OpenTelemetry trace spans.

## 0.7.1 (2023-04-14)
### Bug Fixes

Expand Down
27 changes: 26 additions & 1 deletion sdk/resourcemanager/resourcegraph/armresourcegraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
additional questions or comments.
additional questions or comments.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ require:
- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resourcegraph/resource-manager/readme.md
- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/resourcegraph/resource-manager/readme.go.md
license-header: MICROSOFT_MIT_NO_VERSION
module-version: 0.7.1

```
module: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph
module-version: 0.8.0
azcore-version: 1.7.0-beta.2
generate-fakes: true
inject-spans: true
```
Original file line number Diff line number Diff line change
Expand Up @@ -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/go@4.0.0-preview.51" -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/resourcegraph/armresourcegraph

package armresourcegraph
43 changes: 31 additions & 12 deletions sdk/resourcemanager/resourcegraph/armresourcegraph/client.go

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

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

33 changes: 16 additions & 17 deletions sdk/resourcemanager/resourcegraph/armresourcegraph/constants.go

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

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

Loading