Skip to content

Commit c3780a2

Browse files
author
SDKAuto
committed
CodeGen from PR 3638 in test-repo-billy/azure-rest-api-specs
Merge dc5dfd8ab0f5111b2aadff7ce9f944a1217bf3b2 into d54fc8f349c82c6854de316e16ecbed06791b162
1 parent bb11a9b commit c3780a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4689
-99
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Release History
2+
3+
## 0.1.0 (2025-03-17)
4+
### Other Changes
5+
6+
The package of `github.com/Azure/azure-sdk-for-go/sdk/contosowidget/azmanager` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html).
7+
8+
To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

sdk/contosowidget/azmanager/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Azure Contosowidget Module for Go
2+
3+
The `azmanager` module provides operations for working with Azure Contosowidget.
4+
5+
[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/contosowidget/azmanager)
6+
7+
# Getting started
8+
9+
## Prerequisites
10+
11+
- an [Azure subscription](https://azure.microsoft.com/free/)
12+
- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).)
13+
14+
## Install the package
15+
16+
This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
17+
18+
Install the Azure Contosowidget module:
19+
20+
```sh
21+
go get github.com/Azure/azure-sdk-for-go/sdk/contosowidget/azmanager
22+
```
23+
24+
## Authorization
25+
26+
When creating a client, you will need to provide a credential for authenticating with Azure Contosowidget. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
27+
28+
```go
29+
cred, err := azidentity.NewDefaultAzureCredential(nil)
30+
```
31+
32+
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).
33+
34+
## Client Factory
35+
36+
Azure Contosowidget module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
37+
38+
```go
39+
clientFactory, err := azmanager.NewClientFactory(<subscription ID>, cred, nil)
40+
```
41+
42+
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).
43+
44+
```go
45+
options := arm.ClientOptions {
46+
ClientOptions: azcore.ClientOptions {
47+
Cloud: cloud.AzureChina,
48+
},
49+
}
50+
clientFactory, err := azmanager.NewClientFactory(<subscription ID>, cred, &options)
51+
```
52+
53+
## Clients
54+
55+
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.
56+
57+
```go
58+
client := clientFactory.()
59+
```
60+
61+
## Fakes
62+
63+
The fake package contains types used for constructing in-memory fake servers used in unit tests.
64+
This allows writing tests to cover various success/error conditions without the need for connecting to a live service.
65+
66+
Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.
67+
68+
## Provide Feedback
69+
70+
If you encounter bugs or have suggestions, please
71+
[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Contosowidget` label.
72+
73+
# Contributing
74+
75+
This project welcomes contributions and suggestions. Most contributions require
76+
you to agree to a Contributor License Agreement (CLA) declaring that you have
77+
the right to, and actually do, grant us the rights to use your contribution.
78+
For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
79+
80+
When you submit a pull request, a CLA-bot will automatically determine whether
81+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
82+
comment). Simply follow the instructions provided by the bot. You will only
83+
need to do this once across all repos using our CLA.
84+
85+
This project has adopted the
86+
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
87+
For more information, see the
88+
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
89+
or contact [[email protected]](mailto:[email protected]) with any
90+
additional questions or comments.

sdk/contosowidget/azmanager/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
2+
trigger:
3+
branches:
4+
include:
5+
- main
6+
- feature/*
7+
- hotfix/*
8+
- release/*
9+
paths:
10+
include:
11+
- sdk/contosowidget/azmanager/
12+
13+
pr:
14+
branches:
15+
include:
16+
- main
17+
- feature/*
18+
- hotfix/*
19+
- release/*
20+
paths:
21+
include:
22+
- sdk/contosowidget/azmanager/
23+
24+
extends:
25+
template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
26+
parameters:
27+
IncludeRelease: true
28+
ServiceDirectory: 'contosowidget/azmanager'

sdk/contosowidget/azmanager/constants.go

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/contosowidget/azmanager/fake/internal.go

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/contosowidget/azmanager/fake/time_rfc3339.go

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)