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

[azeventgrid] first client attempt #20940

Merged
merged 29 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
33689fd
First rev of everything.
Jun 2, 2023
e4fe794
bicepping, single test I have passes! Yay!
Jun 2, 2023
1875748
Some autorest transforming
Jun 2, 2023
b4af159
Okay, everything works. Things seemed to be cased correctly as well.
Jun 2, 2023
88edf76
- Able to remove the `endpoint` having to be passed into each operati…
Jun 2, 2023
f483d7a
Implementing a purge as well.
Jun 3, 2023
4127bfe
Another Grace suggestion - remove the `Client` prefixf rom all the ty…
Jun 5, 2023
3e70a10
go mod tidy
Jun 5, 2023
9e659cf
Rename constructor
Jun 5, 2023
94e60bb
Remove unneeded autorest clients directive, upgrade to .49 for bug fi…
Jun 5, 2023
69a4ca6
Remove `eng` folder - there has to be another way to avoid rebuilding…
Jun 5, 2023
08f9f4c
Removed file.
Jun 5, 2023
2dd786c
Had some more experiments in play - want to keep the commented out bu…
Jun 6, 2023
ff65d96
Remove the nono
Jun 6, 2023
c712e8f
Update to the latest and great azcore
Jun 6, 2023
d828f8d
Remove the AzureCoreFoundations prefix.
Jun 6, 2023
2418b1d
Remove dead code.
Jun 6, 2023
9d4331d
Skip live tests when running in plain CI.
Jun 6, 2023
9087939
Adding in recordings
Jun 7, 2023
2ae07b8
more changes
Jun 7, 2023
eb82171
recordings
Jun 8, 2023
32f711c
Got tests working
Jun 8, 2023
6618f61
recordings
Jun 8, 2023
e6d813a
Cleaning up recorded files
Jun 8, 2023
fc561cb
okay, looks like that's an ID, not a path
Jun 8, 2023
25d9cbe
remove old recordings
Jun 8, 2023
09e207e
Some more...
Jun 8, 2023
a23e8e7
update assets.json
Jun 8, 2023
39f5c66
Fix lint errors
Jun 9, 2023
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
5 changes: 5 additions & 0 deletions sdk/messaging/azeventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 0.1.0 (TBD)

* Event Grid package for Event Grid Namespaces
21 changes: 21 additions & 0 deletions sdk/messaging/azeventgrid/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions sdk/messaging/azeventgrid/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
aztemplate

NOTICES AND INFORMATION
Do Not Translate or Localize

This software incorporates material from third parties. Microsoft makes certain
open source code available at https://3rdpartysource.microsoft.com, or you may
send a check or money order for US $5.00, including the product name, the open
source component name, and version number, to:

Source Code Compliance Team
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
USA

Notwithstanding any other terms, you may reverse engineer this software to the
extent required to debug changes to any libraries licensed under the GNU Lesser
General Public License.

------------------------------------------------------------------------------

Azure SDK for Go uses third-party libraries or other resources that may be
distributed under licenses different than the Azure SDK for Go software.

In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:

@microsoft.com

The attached notices are provided for information only.

69 changes: 69 additions & 0 deletions sdk/messaging/azeventgrid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Azure Template Package client library for Go

Azure Template Package client library for Go (`aztemplate`) matches necessary patterns that the development team has established to create a unified SDK written in the Go programming language. These libraries follow the Azure SDK Design Guidelines for Go.

The library allows client libraries to expose common functionality in a consistent fashion. Once you learn how to use these APIs in one client library, you will know how to use them in other client libraries.

## Getting started

For a rich example of a well formatted readme, please check [here.](https://github.com/Azure/azure-sdk/blob/main/docs/policies/README-TEMPLATE.md) In addition, this is an [example readme](https://github.com/Azure/azure-sdk/blob/main/docs/policies/README-EXAMPLE.md) that should be emulated. Note that the top-level sections in this template align with that of the [template.](https://github.com/Azure/azure-sdk/blob/main/docs/policies/README-TEMPLATE.md)

# Key concepts

Bullet point list of your library's main concepts.

# Examples

Examples of some of the key concepts for your library.

# Troubleshooting

Running into issues? This section should contain details as to what to do there.

# Next steps

More sample code should go here, along with links out to the appropriate example tests.

## Contributing
For details on contributing to this repository, see the [contributing guide][azure_sdk_for_go_contributing].

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
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 Helpful Links for Contributors
Many people all over the world have helped make this project better. You'll want to check out:

* [What are some good first issues for new contributors to the repo?](https://github.com/azure/azure-sdk-for-go/issues?q=is%3Aopen+is%3Aissue+label%3A%22up+for+grabs%22)
* [How to build and test your change][azure_sdk_for_go_contributing_developer_guide]
* [How you can make a change happen!][azure_sdk_for_go_contributing_pull_requests]
* Frequently Asked Questions (FAQ) and Conceptual Topics in the detailed [Azure SDK for Go wiki](https://github.com/azure/azure-sdk-for-go/wiki).

<!-- ### Community-->
### Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <[email protected]>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue).

### License

Azure SDK for Go is licensed under the [MIT](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/template/aztemplate/LICENSE.txt) license.

<!-- LINKS -->
[azure_sdk_for_go_contributing]: https://github.com/Azure/azure-sdk-for-go/blob/main/CONTRIBUTING.md
[azure_sdk_for_go_contributing_developer_guide]: https://github.com/Azure/azure-sdk-for-go/blob/main/CONTRIBUTING.md#developer-guide
[azure_sdk_for_go_contributing_pull_requests]: https://github.com/Azure/azure-sdk-for-go/blob/main/CONTRIBUTING.md#pull-requests
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_pattern_circuit_breaker]: https://docs.microsoft.com/azure/architecture/patterns/circuit-breaker
[azure_pattern_retry]: https://docs.microsoft.com/azure/architecture/patterns/retry
[azure_portal]: https://portal.azure.com
[azure_sub]: https://azure.microsoft.com/free/
[cloud_shell]: https://docs.microsoft.com/azure/cloud-shell/overview
[cloud_shell_bash]: https://shell.azure.com/bash
6 changes: 6 additions & 0 deletions sdk/messaging/azeventgrid/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/messaging/azeventgrid",
"Tag": "go/messaging/azeventgrid_3c80211418"
}
64 changes: 64 additions & 0 deletions sdk/messaging/azeventgrid/autorest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## Go

``` yaml
title: EventGridClient
description: Azure Event Grid client
generated-metadata: false
clear-output-folder: false
go: true
input-file:
# This was the commit that everyone used to generate their first official betas.
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/947c9ce9b20900c6cbc8e95bc083e723d09a9c2c/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json
# when we start using the .tsp file directly we can start referring to the compiled output.
# ./tsp-output\@azure-tools\typespec-autorest\2023-06-01-preview\openapi.json
license-header: MICROSOFT_MIT_NO_VERSION
module: github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventgrid
openapi-type: "data-plane"
output-folder: ../azeventgrid
override-client-name: Client
security: "AADToken"
use: "@autorest/[email protected]"
version: "^3.0.0"
directive:
# we have to write a little wrapper code for this so we'll hide the public function
# for now.
- from: client.go
where: $
transform: return $.replace(/PublishCloudEvents\(/g, "internalPublishCloudEvents(");
# make sure the casing of the properties is what compliant.
# - from: swagger-document
# where: $.definitions.CloudEvent.properties.data
# transform: >
# $["type"] = "array"
# - from: swagger-document
# where: $.definitions.CloudEvent.properties.data
# transform: >
# $["items"] = {"type": "byte"}
- from: swagger-document
where: $.definitions.CloudEvent.properties.specversion
transform: $["x-ms-client-name"] = "SpecVersion"
- from: swagger-document
where: $.definitions.CloudEvent.properties.datacontenttype
transform: $["x-ms-client-name"] = "DataContentType"
- from: swagger-document
where: $.definitions.CloudEvent.properties.dataschema
transform: $["x-ms-client-name"] = "DataSchema"
# make the endpoint a parameter of the client constructor
- from: swagger-document
where: $["x-ms-parameterized-host"]
transform: $.parameters[0]["x-ms-parameter-location"] = "client"
# delete client name prefix from method options and response types
- from:
- client.go
- models.go
- response_types.go
where: $
transform: return $.replace(/Client(\w+)((?:Options|Response))/g, "$1$2");
- from:
- client.go
- models.go
- models_serde.go
- response_types.go
where: $
transform: return $.replace(/AzureCoreFoundations/g, "");
```
9 changes: 9 additions & 0 deletions sdk/messaging/azeventgrid/build.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//go:build go1.18
// +build go1.18

//go:generate autorest ./autorest.md
//go:generate gofmt -w .

package azeventgrid
29 changes: 29 additions & 0 deletions sdk/messaging/azeventgrid/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- hotfix/*
- release/*
paths:
include:
- sdk/messaging/azeventgrid
- eng/

pr:
branches:
include:
- main
- feature/*
- hotfix/*
- release/*
paths:
include:
- sdk/messaging/azeventgrid


stages:
- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
ServiceDirectory: 'messaging/azeventgrid'
Loading