Skip to content

Commit fd0ac8c

Browse files
authored
update README.md.tpl format client factory (Azure#20494)
1 parent deba68c commit fd0ac8c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

eng/tools/generator/template/rpName/packageName/README.md.tpl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,31 @@ cred, err := azidentity.NewDefaultAzureCredential(nil)
3333

3434
For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
3535

36-
## Clients
36+
## Client Factory
3737

38-
Azure {{packageTitle}} modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.
38+
Azure {{packageTitle}} module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
3939

4040
```go
41-
client, err := {{packageName}}.{{NewClientName}}(<subscription ID>, cred, nil)
41+
clientFactory, err := {{packageName}}.NewClientFactory(<subscription ID>, cred, nil)
4242
```
4343

4444
You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
4545

4646
```go
47-
options := arm.ClientOptions{
47+
options := arm.ClientOptions {
4848
ClientOptions: azcore.ClientOptions {
4949
Cloud: cloud.AzureChina,
5050
},
5151
}
52-
client, err := {{packageName}}.{{NewClientName}}(<subscription ID>, cred, &options)
52+
client, err := {{packageName}}.NewClientFactory(<subscription ID>, cred, &options)
53+
```
54+
55+
## Clients
56+
57+
A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.
58+
59+
```go
60+
client := clientFactory.{{NewClientName}}()
5361
```
5462

5563
## Provide Feedback

0 commit comments

Comments
 (0)