From ba48c01ee1cf028d439b31d134eb6750312d4d05 Mon Sep 17 00:00:00 2001 From: jonachang Date: Tue, 6 Feb 2024 07:46:28 -0800 Subject: [PATCH 1/8] create client and vendor for armdns --- go.mod | 1 + go.sum | 2 + pkg/deploy/deploy.go | 4 +- .../azureclient/azuresdk/armdns/generate.go | 1 + .../azureclient/azuresdk/armdns/recordsets.go | 45 + pkg/util/azureclient/azuresdk/armdns/zones.go | 1 + .../resourcemanager/dns/armdns/CHANGELOG.md | 21 + .../resourcemanager/dns/armdns/LICENSE.txt | 21 + .../sdk/resourcemanager/dns/armdns/README.md | 92 ++ .../resourcemanager/dns/armdns/autorest.md | 13 + .../sdk/resourcemanager/dns/armdns/build.go | 7 + .../sdk/resourcemanager/dns/armdns/ci.yml | 28 + .../dns/armdns/client_factory.go | 56 ++ .../resourcemanager/dns/armdns/constants.go | 61 ++ .../sdk/resourcemanager/dns/armdns/models.go | 311 ++++++ .../dns/armdns/models_serde.go | 907 ++++++++++++++++++ .../sdk/resourcemanager/dns/armdns/options.go | 121 +++ .../dns/armdns/recordsets_client.go | 560 +++++++++++ .../dns/armdns/resourcereference_client.go | 103 ++ .../dns/armdns/response_types.go | 91 ++ .../dns/armdns/zones_client.go | 452 +++++++++ 21 files changed, 2897 insertions(+), 1 deletion(-) create mode 100644 pkg/util/azureclient/azuresdk/armdns/generate.go create mode 100644 pkg/util/azureclient/azuresdk/armdns/recordsets.go create mode 100644 pkg/util/azureclient/azuresdk/armdns/zones.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/CHANGELOG.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/LICENSE.txt create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/README.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/autorest.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/build.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/ci.yml create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/client_factory.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/constants.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models_serde.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/options.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/recordsets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/resourcereference_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/response_types.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/zones_client.go diff --git a/go.mod b/go.mod index 6bcf71d8de2..886294533b3 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 v2.5.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/adal v0.9.23 diff --git a/go.sum b/go.sum index 5132972fdd5..70361711711 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xO github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 v2.5.0 h1:FTNvxTFH/08JBmhcbL5lmLaGYVXokZM6Ni92Mqr+gSg= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 v2.5.0/go.mod h1:T0ryqIz5h5qg4HOBni+VeRn24alSqOx1Se1IAwUByOk= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 h1:lpOxwrQ919lCZoNCd69rVt8u1eLZuMORrGXqy8sNf3c= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0/go.mod h1:fSvRkb8d26z9dbL40Uf/OO6Vo9iExtZK3D0ulRV+8M0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 h1:HlZMUZW8S4P9oob1nCHxCCKrytxyLc+24nUJGssoEto= diff --git a/pkg/deploy/deploy.go b/pkg/deploy/deploy.go index 07ab5f42da5..75fa2c01d54 100644 --- a/pkg/deploy/deploy.go +++ b/pkg/deploy/deploy.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" mgmtfeatures "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features" "github.com/Azure/go-autorest/autorest/azure" "github.com/jongio/azidext/go/azidext" @@ -90,7 +91,8 @@ func New(ctx context.Context, log *logrus.Entry, _env env.Core, config *RPConfig kvAuthorizer := azidext.NewTokenCredentialAdapter(tokenCredential, scopes) vmssClient := compute.NewVirtualMachineScaleSetsClient(_env.Environment(), config.SubscriptionID, authorizer) - + options := _env.Environment().EnvironmentCredentialOptions() + spTokenCredential, err := azidentity.NewEnvironmentCredential(options) return &deployer{ log: log, env: _env, diff --git a/pkg/util/azureclient/azuresdk/armdns/generate.go b/pkg/util/azureclient/azuresdk/armdns/generate.go new file mode 100644 index 00000000000..cb3c0767e98 --- /dev/null +++ b/pkg/util/azureclient/azuresdk/armdns/generate.go @@ -0,0 +1 @@ +package armdns diff --git a/pkg/util/azureclient/azuresdk/armdns/recordsets.go b/pkg/util/azureclient/azuresdk/armdns/recordsets.go new file mode 100644 index 00000000000..324d2c422b5 --- /dev/null +++ b/pkg/util/azureclient/azuresdk/armdns/recordsets.go @@ -0,0 +1,45 @@ +package armdns + +// Copyright (c) Microsoft Corporation. +// Licensed under the Apache License 2.0. + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + sdkdns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" + + "github.com/Azure/ARO-RP/pkg/util/azureclient" +) + +// RecordSetsClient is a minimal interface for azure RecordSetsClient +type RecordSetsClient interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType sdkdns.RecordType, parameters sdkdns.RecordSet, options *sdkdns.RecordSetsClientCreateOrUpdateOptions) (sdkdns.RecordSetsClientCreateOrUpdateResponse, error) + Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType sdkdns.RecordType, options *sdkdns.RecordSetsClientDeleteOptions) (sdkdns.RecordSetsClientDeleteResponse, error) + Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType sdkdns.RecordType, options *sdkdns.RecordSetsClientGetOptions) (sdkdns.RecordSetsClientGetResponse, error) +} + +type recordSetsClient struct { + sdkdns.RecordSetsClient +} + +var _ RecordSetsClient = &recordSetsClient{} + +// NewRecordSetsClient creates a new RecordSetsClient +func NewRecordSetsClient(environment *azureclient.AROEnvironment, subscriptionID string, credential azidentity.EnvironmentCredential) RecordSetsClient { + options := arm.ClientOptions{ + ClientOptions: azcore.ClientOptions{ + Cloud: environment.Cloud, + }, + } + clientFactory, err := sdkdns.NewClientFactory(subscriptionID, credential, &options) + if err != nil { + return nil + } + client := clientFactory.NewRecordSetsClient() + return &recordSetsClient{ + RecordSetsClient: *client, + } +} diff --git a/pkg/util/azureclient/azuresdk/armdns/zones.go b/pkg/util/azureclient/azuresdk/armdns/zones.go new file mode 100644 index 00000000000..cb3c0767e98 --- /dev/null +++ b/pkg/util/azureclient/azuresdk/armdns/zones.go @@ -0,0 +1 @@ +package armdns diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/CHANGELOG.md new file mode 100644 index 00000000000..e9070946234 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/CHANGELOG.md @@ -0,0 +1,21 @@ +# Release History + +## 1.2.0 (2023-11-24) +### Features Added + +- Support for test fakes and OpenTelemetry trace spans. + + +## 1.1.0 (2023-03-28) +### Features Added + +- New struct `ClientFactory` which is a client factory used to create any client in this module + + +## 1.0.0 (2022-05-17) + +The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. + +To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). + +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/LICENSE.txt new file mode 100644 index 00000000000..dc0c2ffb3dc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. All rights reserved. + +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. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/README.md new file mode 100644 index 00000000000..00c981fabad --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/README.md @@ -0,0 +1,92 @@ +# Azure DNS Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns) + +The `armdns` module provides operations for working with Azure DNS. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/dns/armdns) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- 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).) + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure DNS module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure DNS. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +``` + +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). + +## Client Factory + +Azure DNS module consists of one or more clients. We provide a client factory which could be used to create any client in this module. + +```go +clientFactory, err := armdns.NewClientFactory(, cred, nil) +``` + +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). + +```go +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, +} +clientFactory, err := armdns.NewClientFactory(, cred, &options) +``` + +## Clients + +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. + +```go +client := clientFactory.NewRecordSetsClient() +``` + +## Fakes + +The fake package contains types used for constructing in-memory fake servers used in unit tests. +This allows writing tests to cover various success/error conditions without the need for connecting to a live service. + +Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes. + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `DNS` label. + +# 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](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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/autorest.md new file mode 100644 index 00000000000..e8c4371fad9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/dns/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 1.2.0 + +``` \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/build.go new file mode 100644 index 00000000000..7a8403efa9a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/build.go @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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/dns/armdns + +package armdns diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/ci.yml new file mode 100644 index 00000000000..16c84989357 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/ci.yml @@ -0,0 +1,28 @@ +# 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/resourcemanager/dns/armdns/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/dns/armdns/ + +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + IncludeRelease: true + ServiceDirectory: 'resourcemanager/dns/armdns' diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/client_factory.go new file mode 100644 index 00000000000..a844cbb964b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/client_factory.go @@ -0,0 +1,56 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + subscriptionID string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + subscriptionID: subscriptionID, credential: credential, + options: options.Clone(), + }, nil +} + +// NewRecordSetsClient creates a new instance of RecordSetsClient. +func (c *ClientFactory) NewRecordSetsClient() *RecordSetsClient { + subClient, _ := NewRecordSetsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewResourceReferenceClient creates a new instance of ResourceReferenceClient. +func (c *ClientFactory) NewResourceReferenceClient() *ResourceReferenceClient { + subClient, _ := NewResourceReferenceClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewZonesClient creates a new instance of ZonesClient. +func (c *ClientFactory) NewZonesClient() *ZonesClient { + subClient, _ := NewZonesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/constants.go new file mode 100644 index 00000000000..1dbee716be3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/constants.go @@ -0,0 +1,61 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +const ( + moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" + moduleVersion = "v1.2.0" +) + +type RecordType string + +const ( + RecordTypeA RecordType = "A" + RecordTypeAAAA RecordType = "AAAA" + RecordTypeCAA RecordType = "CAA" + RecordTypeCNAME RecordType = "CNAME" + RecordTypeMX RecordType = "MX" + RecordTypeNS RecordType = "NS" + RecordTypePTR RecordType = "PTR" + RecordTypeSOA RecordType = "SOA" + RecordTypeSRV RecordType = "SRV" + RecordTypeTXT RecordType = "TXT" +) + +// PossibleRecordTypeValues returns the possible values for the RecordType const type. +func PossibleRecordTypeValues() []RecordType { + return []RecordType{ + RecordTypeA, + RecordTypeAAAA, + RecordTypeCAA, + RecordTypeCNAME, + RecordTypeMX, + RecordTypeNS, + RecordTypePTR, + RecordTypeSOA, + RecordTypeSRV, + RecordTypeTXT, + } +} + +// ZoneType - The type of this DNS zone (Public or Private). +type ZoneType string + +const ( + ZoneTypePrivate ZoneType = "Private" + ZoneTypePublic ZoneType = "Public" +) + +// PossibleZoneTypeValues returns the possible values for the ZoneType const type. +func PossibleZoneTypeValues() []ZoneType { + return []ZoneType{ + ZoneTypePrivate, + ZoneTypePublic, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models.go new file mode 100644 index 00000000000..7b451eb222a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models.go @@ -0,0 +1,311 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +// ARecord - An A record. +type ARecord struct { + // The IPv4 address of this A record. + IPv4Address *string +} + +// AaaaRecord - An AAAA record. +type AaaaRecord struct { + // The IPv6 address of this AAAA record. + IPv6Address *string +} + +// CaaRecord - A CAA record. +type CaaRecord struct { + // The flags for this CAA record as an integer between 0 and 255. + Flags *int32 + + // The tag for this CAA record. + Tag *string + + // The value for this CAA record. + Value *string +} + +// CnameRecord - A CNAME record. +type CnameRecord struct { + // The canonical name for this CNAME record. + Cname *string +} + +// MxRecord - An MX record. +type MxRecord struct { + // The domain name of the mail host for this MX record. + Exchange *string + + // The preference value for this MX record. + Preference *int32 +} + +// NsRecord - An NS record. +type NsRecord struct { + // The name server name for this NS record. + Nsdname *string +} + +// PtrRecord - A PTR record. +type PtrRecord struct { + // The PTR target domain name for this PTR record. + Ptrdname *string +} + +// RecordSet - Describes a DNS record set (a collection of DNS records with the same name and type). +type RecordSet struct { + // The etag of the record set. + Etag *string + + // The properties of the record set. + Properties *RecordSetProperties + + // READ-ONLY; The ID of the record set. + ID *string + + // READ-ONLY; The name of the record set. + Name *string + + // READ-ONLY; The type of the record set. + Type *string +} + +// RecordSetListResult - The response to a record set List operation. +type RecordSetListResult struct { + // Information about the record sets in the response. + Value []*RecordSet + + // READ-ONLY; The continuation token for the next page of results. + NextLink *string +} + +// RecordSetProperties - Represents the properties of the records in the record set. +type RecordSetProperties struct { + // The list of A records in the record set. + ARecords []*ARecord + + // The list of AAAA records in the record set. + AaaaRecords []*AaaaRecord + + // The list of CAA records in the record set. + CaaRecords []*CaaRecord + + // The CNAME record in the record set. + CnameRecord *CnameRecord + + // The metadata attached to the record set. + Metadata map[string]*string + + // The list of MX records in the record set. + MxRecords []*MxRecord + + // The list of NS records in the record set. + NsRecords []*NsRecord + + // The list of PTR records in the record set. + PtrRecords []*PtrRecord + + // The SOA record in the record set. + SoaRecord *SoaRecord + + // The list of SRV records in the record set. + SrvRecords []*SrvRecord + + // The TTL (time-to-live) of the records in the record set. + TTL *int64 + + // A reference to an azure resource from where the dns resource value is taken. + TargetResource *SubResource + + // The list of TXT records in the record set. + TxtRecords []*TxtRecord + + // READ-ONLY; Fully qualified domain name of the record set. + Fqdn *string + + // READ-ONLY; provisioning State of the record set. + ProvisioningState *string +} + +// RecordSetUpdateParameters - Parameters supplied to update a record set. +type RecordSetUpdateParameters struct { + // Specifies information about the record set being updated. + RecordSet *RecordSet +} + +// Resource - Common properties of an Azure Resource Manager resource +type Resource struct { + // REQUIRED; Resource location. + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ResourceReference - Represents a single Azure resource and its referencing DNS records. +type ResourceReference struct { + // A list of dns Records + DNSResources []*SubResource + + // A reference to an azure resource from where the dns resource value is taken. + TargetResource *SubResource +} + +// ResourceReferenceRequest - Represents the properties of the Dns Resource Reference Request. +type ResourceReferenceRequest struct { + // The properties of the Resource Reference Request. + Properties *ResourceReferenceRequestProperties +} + +// ResourceReferenceRequestProperties - Represents the properties of the Dns Resource Reference Request. +type ResourceReferenceRequestProperties struct { + // A list of references to azure resources for which referencing dns records need to be queried. + TargetResources []*SubResource +} + +// ResourceReferenceResult - Represents the properties of the Dns Resource Reference Result. +type ResourceReferenceResult struct { + // The result of dns resource reference request. Returns a list of dns resource references for each of the azure resource + // in the request. + Properties *ResourceReferenceResultProperties +} + +// ResourceReferenceResultProperties - The result of dns resource reference request. Returns a list of dns resource references +// for each of the azure resource in the request. +type ResourceReferenceResultProperties struct { + // The result of dns resource reference request. A list of dns resource references for each of the azure resource in the request + DNSResourceReferences []*ResourceReference +} + +// SoaRecord - An SOA record. +type SoaRecord struct { + // The email contact for this SOA record. + Email *string + + // The expire time for this SOA record. + ExpireTime *int64 + + // The domain name of the authoritative name server for this SOA record. + Host *string + + // The minimum value for this SOA record. By convention this is used to determine the negative caching duration. + MinimumTTL *int64 + + // The refresh value for this SOA record. + RefreshTime *int64 + + // The retry time for this SOA record. + RetryTime *int64 + + // The serial number for this SOA record. + SerialNumber *int64 +} + +// SrvRecord - An SRV record. +type SrvRecord struct { + // The port value for this SRV record. + Port *int32 + + // The priority value for this SRV record. + Priority *int32 + + // The target domain name for this SRV record. + Target *string + + // The weight value for this SRV record. + Weight *int32 +} + +// SubResource - A reference to a another resource +type SubResource struct { + // Resource Id. + ID *string +} + +// TxtRecord - A TXT record. +type TxtRecord struct { + // The text value of this TXT record. + Value []*string +} + +// Zone - Describes a DNS zone. +type Zone struct { + // REQUIRED; Resource location. + Location *string + + // The etag of the zone. + Etag *string + + // The properties of the zone. + Properties *ZoneProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource name. + Name *string + + // READ-ONLY; Resource type. + Type *string +} + +// ZoneListResult - The response to a Zone List or ListAll operation. +type ZoneListResult struct { + // Information about the DNS zones. + Value []*Zone + + // READ-ONLY; The continuation token for the next page of results. + NextLink *string +} + +// ZoneProperties - Represents the properties of the zone. +type ZoneProperties struct { + // A list of references to virtual networks that register hostnames in this DNS zone. This is a only when ZoneType is Private. + RegistrationVirtualNetworks []*SubResource + + // A list of references to virtual networks that resolve records in this DNS zone. This is a only when ZoneType is Private. + ResolutionVirtualNetworks []*SubResource + + // The type of this DNS zone (Public or Private). + ZoneType *ZoneType + + // READ-ONLY; The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any + // attempt to set this value will be ignored. + MaxNumberOfRecordSets *int64 + + // READ-ONLY; The maximum number of records per record set that can be created in this DNS zone. This is a read-only property + // and any attempt to set this value will be ignored. + MaxNumberOfRecordsPerRecordSet *int64 + + // READ-ONLY; The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored. + NameServers []*string + + // READ-ONLY; The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this + // value will be ignored. + NumberOfRecordSets *int64 +} + +// ZoneUpdate - Describes a request to update a DNS zone. +type ZoneUpdate struct { + // Resource tags. + Tags map[string]*string +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models_serde.go new file mode 100644 index 00000000000..b75889c40dd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/models_serde.go @@ -0,0 +1,907 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type ARecord. +func (a ARecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipv4Address", a.IPv4Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ARecord. +func (a *ARecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipv4Address": + err = unpopulate(val, "IPv4Address", &a.IPv4Address) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AaaaRecord. +func (a AaaaRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipv6Address", a.IPv6Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AaaaRecord. +func (a *AaaaRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipv6Address": + err = unpopulate(val, "IPv6Address", &a.IPv6Address) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CaaRecord. +func (c CaaRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "flags", c.Flags) + populate(objectMap, "tag", c.Tag) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CaaRecord. +func (c *CaaRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "flags": + err = unpopulate(val, "Flags", &c.Flags) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &c.Tag) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CnameRecord. +func (c CnameRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cname", c.Cname) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CnameRecord. +func (c *CnameRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cname": + err = unpopulate(val, "Cname", &c.Cname) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MxRecord. +func (m MxRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exchange", m.Exchange) + populate(objectMap, "preference", m.Preference) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MxRecord. +func (m *MxRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exchange": + err = unpopulate(val, "Exchange", &m.Exchange) + delete(rawMsg, key) + case "preference": + err = unpopulate(val, "Preference", &m.Preference) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NsRecord. +func (n NsRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nsdname", n.Nsdname) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NsRecord. +func (n *NsRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nsdname": + err = unpopulate(val, "Nsdname", &n.Nsdname) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PtrRecord. +func (p PtrRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ptrdname", p.Ptrdname) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PtrRecord. +func (p *PtrRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ptrdname": + err = unpopulate(val, "Ptrdname", &p.Ptrdname) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecordSet. +func (r RecordSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecordSet. +func (r *RecordSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &r.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecordSetListResult. +func (r RecordSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetListResult. +func (r *RecordSetListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecordSetProperties. +func (r RecordSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ARecords", r.ARecords) + populate(objectMap, "AAAARecords", r.AaaaRecords) + populate(objectMap, "caaRecords", r.CaaRecords) + populate(objectMap, "CNAMERecord", r.CnameRecord) + populate(objectMap, "fqdn", r.Fqdn) + populate(objectMap, "metadata", r.Metadata) + populate(objectMap, "MXRecords", r.MxRecords) + populate(objectMap, "NSRecords", r.NsRecords) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "PTRRecords", r.PtrRecords) + populate(objectMap, "SOARecord", r.SoaRecord) + populate(objectMap, "SRVRecords", r.SrvRecords) + populate(objectMap, "TTL", r.TTL) + populate(objectMap, "targetResource", r.TargetResource) + populate(objectMap, "TXTRecords", r.TxtRecords) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetProperties. +func (r *RecordSetProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ARecords": + err = unpopulate(val, "ARecords", &r.ARecords) + delete(rawMsg, key) + case "AAAARecords": + err = unpopulate(val, "AaaaRecords", &r.AaaaRecords) + delete(rawMsg, key) + case "caaRecords": + err = unpopulate(val, "CaaRecords", &r.CaaRecords) + delete(rawMsg, key) + case "CNAMERecord": + err = unpopulate(val, "CnameRecord", &r.CnameRecord) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &r.Fqdn) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &r.Metadata) + delete(rawMsg, key) + case "MXRecords": + err = unpopulate(val, "MxRecords", &r.MxRecords) + delete(rawMsg, key) + case "NSRecords": + err = unpopulate(val, "NsRecords", &r.NsRecords) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "PTRRecords": + err = unpopulate(val, "PtrRecords", &r.PtrRecords) + delete(rawMsg, key) + case "SOARecord": + err = unpopulate(val, "SoaRecord", &r.SoaRecord) + delete(rawMsg, key) + case "SRVRecords": + err = unpopulate(val, "SrvRecords", &r.SrvRecords) + delete(rawMsg, key) + case "TTL": + err = unpopulate(val, "TTL", &r.TTL) + delete(rawMsg, key) + case "targetResource": + err = unpopulate(val, "TargetResource", &r.TargetResource) + delete(rawMsg, key) + case "TXTRecords": + err = unpopulate(val, "TxtRecords", &r.TxtRecords) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecordSetUpdateParameters. +func (r RecordSetUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "RecordSet", r.RecordSet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecordSetUpdateParameters. +func (r *RecordSetUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "RecordSet": + err = unpopulate(val, "RecordSet", &r.RecordSet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReference. +func (r ResourceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsResources", r.DNSResources) + populate(objectMap, "targetResource", r.TargetResource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference. +func (r *ResourceReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsResources": + err = unpopulate(val, "DNSResources", &r.DNSResources) + delete(rawMsg, key) + case "targetResource": + err = unpopulate(val, "TargetResource", &r.TargetResource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReferenceRequest. +func (r ResourceReferenceRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceRequest. +func (r *ResourceReferenceRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReferenceRequestProperties. +func (r ResourceReferenceRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetResources", r.TargetResources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceRequestProperties. +func (r *ResourceReferenceRequestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "targetResources": + err = unpopulate(val, "TargetResources", &r.TargetResources) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReferenceResult. +func (r ResourceReferenceResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceResult. +func (r *ResourceReferenceResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReferenceResultProperties. +func (r ResourceReferenceResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dnsResourceReferences", r.DNSResourceReferences) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReferenceResultProperties. +func (r *ResourceReferenceResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dnsResourceReferences": + err = unpopulate(val, "DNSResourceReferences", &r.DNSResourceReferences) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoaRecord. +func (s SoaRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "email", s.Email) + populate(objectMap, "expireTime", s.ExpireTime) + populate(objectMap, "host", s.Host) + populate(objectMap, "minimumTTL", s.MinimumTTL) + populate(objectMap, "refreshTime", s.RefreshTime) + populate(objectMap, "retryTime", s.RetryTime) + populate(objectMap, "serialNumber", s.SerialNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoaRecord. +func (s *SoaRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "email": + err = unpopulate(val, "Email", &s.Email) + delete(rawMsg, key) + case "expireTime": + err = unpopulate(val, "ExpireTime", &s.ExpireTime) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &s.Host) + delete(rawMsg, key) + case "minimumTTL": + err = unpopulate(val, "MinimumTTL", &s.MinimumTTL) + delete(rawMsg, key) + case "refreshTime": + err = unpopulate(val, "RefreshTime", &s.RefreshTime) + delete(rawMsg, key) + case "retryTime": + err = unpopulate(val, "RetryTime", &s.RetryTime) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, "SerialNumber", &s.SerialNumber) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SrvRecord. +func (s SrvRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", s.Port) + populate(objectMap, "priority", s.Priority) + populate(objectMap, "target", s.Target) + populate(objectMap, "weight", s.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SrvRecord. +func (s *SrvRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &s.Priority) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &s.Target) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &s.Weight) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubResource. +func (s SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource. +func (s *SubResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TxtRecord. +func (t TxtRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TxtRecord. +func (t *TxtRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Zone. +func (z Zone) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", z.Etag) + populate(objectMap, "id", z.ID) + populate(objectMap, "location", z.Location) + populate(objectMap, "name", z.Name) + populate(objectMap, "properties", z.Properties) + populate(objectMap, "tags", z.Tags) + populate(objectMap, "type", z.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Zone. +func (z *Zone) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &z.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &z.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &z.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &z.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &z.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &z.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &z.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ZoneListResult. +func (z ZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", z.NextLink) + populate(objectMap, "value", z.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ZoneListResult. +func (z *ZoneListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &z.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &z.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ZoneProperties. +func (z ZoneProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxNumberOfRecordSets", z.MaxNumberOfRecordSets) + populate(objectMap, "maxNumberOfRecordsPerRecordSet", z.MaxNumberOfRecordsPerRecordSet) + populate(objectMap, "nameServers", z.NameServers) + populate(objectMap, "numberOfRecordSets", z.NumberOfRecordSets) + populate(objectMap, "registrationVirtualNetworks", z.RegistrationVirtualNetworks) + populate(objectMap, "resolutionVirtualNetworks", z.ResolutionVirtualNetworks) + populate(objectMap, "zoneType", z.ZoneType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ZoneProperties. +func (z *ZoneProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxNumberOfRecordSets": + err = unpopulate(val, "MaxNumberOfRecordSets", &z.MaxNumberOfRecordSets) + delete(rawMsg, key) + case "maxNumberOfRecordsPerRecordSet": + err = unpopulate(val, "MaxNumberOfRecordsPerRecordSet", &z.MaxNumberOfRecordsPerRecordSet) + delete(rawMsg, key) + case "nameServers": + err = unpopulate(val, "NameServers", &z.NameServers) + delete(rawMsg, key) + case "numberOfRecordSets": + err = unpopulate(val, "NumberOfRecordSets", &z.NumberOfRecordSets) + delete(rawMsg, key) + case "registrationVirtualNetworks": + err = unpopulate(val, "RegistrationVirtualNetworks", &z.RegistrationVirtualNetworks) + delete(rawMsg, key) + case "resolutionVirtualNetworks": + err = unpopulate(val, "ResolutionVirtualNetworks", &z.ResolutionVirtualNetworks) + delete(rawMsg, key) + case "zoneType": + err = unpopulate(val, "ZoneType", &z.ZoneType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ZoneUpdate. +func (z ZoneUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", z.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ZoneUpdate. +func (z *ZoneUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &z.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", z, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/options.go new file mode 100644 index 00000000000..9275d5d7d7b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/options.go @@ -0,0 +1,121 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +// RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate method. +type RecordSetsClientCreateOrUpdateOptions struct { + // The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value + // to prevent accidentally overwriting any concurrent changes. + IfMatch *string + + // Set to '*' to allow a new record set to be created, but to prevent updating an existing record set. Other values will be + // ignored. + IfNoneMatch *string +} + +// RecordSetsClientDeleteOptions contains the optional parameters for the RecordSetsClient.Delete method. +type RecordSetsClientDeleteOptions struct { + // The etag of the record set. Omit this value to always delete the current record set. Specify the last-seen etag value to + // prevent accidentally deleting any concurrent changes. + IfMatch *string +} + +// RecordSetsClientGetOptions contains the optional parameters for the RecordSetsClient.Get method. +type RecordSetsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RecordSetsClientListAllByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListAllByDNSZonePager +// method. +type RecordSetsClientListAllByDNSZoneOptions struct { + // The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is + // specified, Enumeration will return only records that end with . + RecordSetNameSuffix *string + + // The maximum number of record sets to return. If not specified, returns up to 100 record sets. + Top *int32 +} + +// RecordSetsClientListByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListByDNSZonePager method. +type RecordSetsClientListByDNSZoneOptions struct { + // The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is + // specified, Enumeration will return only records that end with . + Recordsetnamesuffix *string + + // The maximum number of record sets to return. If not specified, returns up to 100 record sets. + Top *int32 +} + +// RecordSetsClientListByTypeOptions contains the optional parameters for the RecordSetsClient.NewListByTypePager method. +type RecordSetsClientListByTypeOptions struct { + // The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is + // specified, Enumeration will return only records that end with . + Recordsetnamesuffix *string + + // The maximum number of record sets to return. If not specified, returns up to 100 record sets. + Top *int32 +} + +// RecordSetsClientUpdateOptions contains the optional parameters for the RecordSetsClient.Update method. +type RecordSetsClientUpdateOptions struct { + // The etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag value + // to prevent accidentally overwriting concurrent changes. + IfMatch *string +} + +// ResourceReferenceClientGetByTargetResourcesOptions contains the optional parameters for the ResourceReferenceClient.GetByTargetResources +// method. +type ResourceReferenceClientGetByTargetResourcesOptions struct { + // placeholder for future optional parameters +} + +// ZonesClientBeginDeleteOptions contains the optional parameters for the ZonesClient.BeginDelete method. +type ZonesClientBeginDeleteOptions struct { + // The etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen etag value to prevent + // accidentally deleting any concurrent changes. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ZonesClientCreateOrUpdateOptions contains the optional parameters for the ZonesClient.CreateOrUpdate method. +type ZonesClientCreateOrUpdateOptions struct { + // The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent + // accidentally overwriting any concurrent changes. + IfMatch *string + + // Set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone. Other values will be ignored. + IfNoneMatch *string +} + +// ZonesClientGetOptions contains the optional parameters for the ZonesClient.Get method. +type ZonesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ZonesClientListByResourceGroupOptions contains the optional parameters for the ZonesClient.NewListByResourceGroupPager +// method. +type ZonesClientListByResourceGroupOptions struct { + // The maximum number of record sets to return. If not specified, returns up to 100 record sets. + Top *int32 +} + +// ZonesClientListOptions contains the optional parameters for the ZonesClient.NewListPager method. +type ZonesClientListOptions struct { + // The maximum number of DNS zones to return. If not specified, returns up to 100 zones. + Top *int32 +} + +// ZonesClientUpdateOptions contains the optional parameters for the ZonesClient.Update method. +type ZonesClientUpdateOptions struct { + // The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent + // accidentally overwriting any concurrent changes. + IfMatch *string +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/recordsets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/recordsets_client.go new file mode 100644 index 00000000000..b1da1158b26 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/recordsets_client.go @@ -0,0 +1,560 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RecordSetsClient contains the methods for the RecordSets group. +// Don't use this type directly, use NewRecordSetsClient() instead. +type RecordSetsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewRecordSetsClient creates a new instance of RecordSetsClient with the specified values. +// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewRecordSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecordSetsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &RecordSetsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a record set within a DNS zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - relativeRecordSetName - The name of the record set, relative to the name of the zone. +// - recordType - The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are +// created when the DNS zone is created). +// - parameters - Parameters supplied to the CreateOrUpdate operation. +// - options - RecordSetsClientCreateOrUpdateOptions contains the optional parameters for the RecordSetsClient.CreateOrUpdate +// method. +func (client *RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, options *RecordSetsClientCreateOrUpdateOptions) (RecordSetsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "RecordSetsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, options) + if err != nil { + return RecordSetsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RecordSetsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return RecordSetsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *RecordSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, options *RecordSetsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + urlPath = strings.ReplaceAll(urlPath, "{relativeRecordSetName}", relativeRecordSetName) + if recordType == "" { + return nil, errors.New("parameter recordType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{recordType}", url.PathEscape(string(recordType))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *RecordSetsClient) createOrUpdateHandleResponse(resp *http.Response) (RecordSetsClientCreateOrUpdateResponse, error) { + result := RecordSetsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecordSet); err != nil { + return RecordSetsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a record set from a DNS zone. This operation cannot be undone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - relativeRecordSetName - The name of the record set, relative to the name of the zone. +// - recordType - The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when +// the DNS zone is deleted). +// - options - RecordSetsClientDeleteOptions contains the optional parameters for the RecordSetsClient.Delete method. +func (client *RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientDeleteOptions) (RecordSetsClientDeleteResponse, error) { + var err error + const operationName = "RecordSetsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, options) + if err != nil { + return RecordSetsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RecordSetsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return RecordSetsClientDeleteResponse{}, err + } + return RecordSetsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *RecordSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + urlPath = strings.ReplaceAll(urlPath, "{relativeRecordSetName}", relativeRecordSetName) + if recordType == "" { + return nil, errors.New("parameter recordType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{recordType}", url.PathEscape(string(recordType))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a record set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - relativeRecordSetName - The name of the record set, relative to the name of the zone. +// - recordType - The type of DNS record in this record set. +// - options - RecordSetsClientGetOptions contains the optional parameters for the RecordSetsClient.Get method. +func (client *RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientGetOptions) (RecordSetsClientGetResponse, error) { + var err error + const operationName = "RecordSetsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, options) + if err != nil { + return RecordSetsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RecordSetsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecordSetsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *RecordSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, options *RecordSetsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + urlPath = strings.ReplaceAll(urlPath, "{relativeRecordSetName}", relativeRecordSetName) + if recordType == "" { + return nil, errors.New("parameter recordType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{recordType}", url.PathEscape(string(recordType))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *RecordSetsClient) getHandleResponse(resp *http.Response) (RecordSetsClientGetResponse, error) { + result := RecordSetsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecordSet); err != nil { + return RecordSetsClientGetResponse{}, err + } + return result, nil +} + +// NewListAllByDNSZonePager - Lists all record sets in a DNS zone. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - RecordSetsClientListAllByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListAllByDNSZonePager +// method. +func (client *RecordSetsClient) NewListAllByDNSZonePager(resourceGroupName string, zoneName string, options *RecordSetsClientListAllByDNSZoneOptions) *runtime.Pager[RecordSetsClientListAllByDNSZoneResponse] { + return runtime.NewPager(runtime.PagingHandler[RecordSetsClientListAllByDNSZoneResponse]{ + More: func(page RecordSetsClientListAllByDNSZoneResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RecordSetsClientListAllByDNSZoneResponse) (RecordSetsClientListAllByDNSZoneResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RecordSetsClient.NewListAllByDNSZonePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listAllByDNSZoneCreateRequest(ctx, resourceGroupName, zoneName, options) + }, nil) + if err != nil { + return RecordSetsClientListAllByDNSZoneResponse{}, err + } + return client.listAllByDNSZoneHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listAllByDNSZoneCreateRequest creates the ListAllByDNSZone request. +func (client *RecordSetsClient) listAllByDNSZoneCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *RecordSetsClientListAllByDNSZoneOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/all" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.RecordSetNameSuffix != nil { + reqQP.Set("$recordsetnamesuffix", *options.RecordSetNameSuffix) + } + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAllByDNSZoneHandleResponse handles the ListAllByDNSZone response. +func (client *RecordSetsClient) listAllByDNSZoneHandleResponse(resp *http.Response) (RecordSetsClientListAllByDNSZoneResponse, error) { + result := RecordSetsClientListAllByDNSZoneResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecordSetListResult); err != nil { + return RecordSetsClientListAllByDNSZoneResponse{}, err + } + return result, nil +} + +// NewListByDNSZonePager - Lists all record sets in a DNS zone. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - RecordSetsClientListByDNSZoneOptions contains the optional parameters for the RecordSetsClient.NewListByDNSZonePager +// method. +func (client *RecordSetsClient) NewListByDNSZonePager(resourceGroupName string, zoneName string, options *RecordSetsClientListByDNSZoneOptions) *runtime.Pager[RecordSetsClientListByDNSZoneResponse] { + return runtime.NewPager(runtime.PagingHandler[RecordSetsClientListByDNSZoneResponse]{ + More: func(page RecordSetsClientListByDNSZoneResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RecordSetsClientListByDNSZoneResponse) (RecordSetsClientListByDNSZoneResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RecordSetsClient.NewListByDNSZonePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByDNSZoneCreateRequest(ctx, resourceGroupName, zoneName, options) + }, nil) + if err != nil { + return RecordSetsClientListByDNSZoneResponse{}, err + } + return client.listByDNSZoneHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByDNSZoneCreateRequest creates the ListByDNSZone request. +func (client *RecordSetsClient) listByDNSZoneCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *RecordSetsClientListByDNSZoneOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/recordsets" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Recordsetnamesuffix != nil { + reqQP.Set("$recordsetnamesuffix", *options.Recordsetnamesuffix) + } + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDNSZoneHandleResponse handles the ListByDNSZone response. +func (client *RecordSetsClient) listByDNSZoneHandleResponse(resp *http.Response) (RecordSetsClientListByDNSZoneResponse, error) { + result := RecordSetsClientListByDNSZoneResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecordSetListResult); err != nil { + return RecordSetsClientListByDNSZoneResponse{}, err + } + return result, nil +} + +// NewListByTypePager - Lists the record sets of a specified type in a DNS zone. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - recordType - The type of record sets to enumerate. +// - options - RecordSetsClientListByTypeOptions contains the optional parameters for the RecordSetsClient.NewListByTypePager +// method. +func (client *RecordSetsClient) NewListByTypePager(resourceGroupName string, zoneName string, recordType RecordType, options *RecordSetsClientListByTypeOptions) *runtime.Pager[RecordSetsClientListByTypeResponse] { + return runtime.NewPager(runtime.PagingHandler[RecordSetsClientListByTypeResponse]{ + More: func(page RecordSetsClientListByTypeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *RecordSetsClientListByTypeResponse) (RecordSetsClientListByTypeResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RecordSetsClient.NewListByTypePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByTypeCreateRequest(ctx, resourceGroupName, zoneName, recordType, options) + }, nil) + if err != nil { + return RecordSetsClientListByTypeResponse{}, err + } + return client.listByTypeHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByTypeCreateRequest creates the ListByType request. +func (client *RecordSetsClient) listByTypeCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, options *RecordSetsClientListByTypeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if recordType == "" { + return nil, errors.New("parameter recordType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{recordType}", url.PathEscape(string(recordType))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Recordsetnamesuffix != nil { + reqQP.Set("$recordsetnamesuffix", *options.Recordsetnamesuffix) + } + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByTypeHandleResponse handles the ListByType response. +func (client *RecordSetsClient) listByTypeHandleResponse(resp *http.Response) (RecordSetsClientListByTypeResponse, error) { + result := RecordSetsClientListByTypeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecordSetListResult); err != nil { + return RecordSetsClientListByTypeResponse{}, err + } + return result, nil +} + +// Update - Updates a record set within a DNS zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - relativeRecordSetName - The name of the record set, relative to the name of the zone. +// - recordType - The type of DNS record in this record set. +// - parameters - Parameters supplied to the Update operation. +// - options - RecordSetsClientUpdateOptions contains the optional parameters for the RecordSetsClient.Update method. +func (client *RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, options *RecordSetsClientUpdateOptions) (RecordSetsClientUpdateResponse, error) { + var err error + const operationName = "RecordSetsClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, options) + if err != nil { + return RecordSetsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return RecordSetsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecordSetsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *RecordSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, options *RecordSetsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/{recordType}/{relativeRecordSetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + urlPath = strings.ReplaceAll(urlPath, "{relativeRecordSetName}", relativeRecordSetName) + if recordType == "" { + return nil, errors.New("parameter recordType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{recordType}", url.PathEscape(string(recordType))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *RecordSetsClient) updateHandleResponse(resp *http.Response) (RecordSetsClientUpdateResponse, error) { + result := RecordSetsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecordSet); err != nil { + return RecordSetsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/resourcereference_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/resourcereference_client.go new file mode 100644 index 00000000000..215f43b1641 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/resourcereference_client.go @@ -0,0 +1,103 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ResourceReferenceClient contains the methods for the DNSResourceReference group. +// Don't use this type directly, use NewResourceReferenceClient() instead. +type ResourceReferenceClient struct { + internal *arm.Client + subscriptionID string +} + +// NewResourceReferenceClient creates a new instance of ResourceReferenceClient with the specified values. +// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewResourceReferenceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceReferenceClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ResourceReferenceClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// GetByTargetResources - Returns the DNS records specified by the referencing targetResourceIds. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - parameters - Properties for dns resource reference request. +// - options - ResourceReferenceClientGetByTargetResourcesOptions contains the optional parameters for the ResourceReferenceClient.GetByTargetResources +// method. +func (client *ResourceReferenceClient) GetByTargetResources(ctx context.Context, parameters ResourceReferenceRequest, options *ResourceReferenceClientGetByTargetResourcesOptions) (ResourceReferenceClientGetByTargetResourcesResponse, error) { + var err error + const operationName = "ResourceReferenceClient.GetByTargetResources" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getByTargetResourcesCreateRequest(ctx, parameters, options) + if err != nil { + return ResourceReferenceClientGetByTargetResourcesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ResourceReferenceClientGetByTargetResourcesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceReferenceClientGetByTargetResourcesResponse{}, err + } + resp, err := client.getByTargetResourcesHandleResponse(httpResp) + return resp, err +} + +// getByTargetResourcesCreateRequest creates the GetByTargetResources request. +func (client *ResourceReferenceClient) getByTargetResourcesCreateRequest(ctx context.Context, parameters ResourceReferenceRequest, options *ResourceReferenceClientGetByTargetResourcesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/getDnsResourceReference" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// getByTargetResourcesHandleResponse handles the GetByTargetResources response. +func (client *ResourceReferenceClient) getByTargetResourcesHandleResponse(resp *http.Response) (ResourceReferenceClientGetByTargetResourcesResponse, error) { + result := ResourceReferenceClientGetByTargetResourcesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceReferenceResult); err != nil { + return ResourceReferenceClientGetByTargetResourcesResponse{}, err + } + return result, nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/response_types.go new file mode 100644 index 00000000000..ccf318d38be --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/response_types.go @@ -0,0 +1,91 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +// RecordSetsClientCreateOrUpdateResponse contains the response from method RecordSetsClient.CreateOrUpdate. +type RecordSetsClientCreateOrUpdateResponse struct { + // Describes a DNS record set (a collection of DNS records with the same name and type). + RecordSet +} + +// RecordSetsClientDeleteResponse contains the response from method RecordSetsClient.Delete. +type RecordSetsClientDeleteResponse struct { + // placeholder for future response values +} + +// RecordSetsClientGetResponse contains the response from method RecordSetsClient.Get. +type RecordSetsClientGetResponse struct { + // Describes a DNS record set (a collection of DNS records with the same name and type). + RecordSet +} + +// RecordSetsClientListAllByDNSZoneResponse contains the response from method RecordSetsClient.NewListAllByDNSZonePager. +type RecordSetsClientListAllByDNSZoneResponse struct { + // The response to a record set List operation. + RecordSetListResult +} + +// RecordSetsClientListByDNSZoneResponse contains the response from method RecordSetsClient.NewListByDNSZonePager. +type RecordSetsClientListByDNSZoneResponse struct { + // The response to a record set List operation. + RecordSetListResult +} + +// RecordSetsClientListByTypeResponse contains the response from method RecordSetsClient.NewListByTypePager. +type RecordSetsClientListByTypeResponse struct { + // The response to a record set List operation. + RecordSetListResult +} + +// RecordSetsClientUpdateResponse contains the response from method RecordSetsClient.Update. +type RecordSetsClientUpdateResponse struct { + // Describes a DNS record set (a collection of DNS records with the same name and type). + RecordSet +} + +// ResourceReferenceClientGetByTargetResourcesResponse contains the response from method ResourceReferenceClient.GetByTargetResources. +type ResourceReferenceClientGetByTargetResourcesResponse struct { + // Represents the properties of the Dns Resource Reference Result. + ResourceReferenceResult +} + +// ZonesClientCreateOrUpdateResponse contains the response from method ZonesClient.CreateOrUpdate. +type ZonesClientCreateOrUpdateResponse struct { + // Describes a DNS zone. + Zone +} + +// ZonesClientDeleteResponse contains the response from method ZonesClient.BeginDelete. +type ZonesClientDeleteResponse struct { + // placeholder for future response values +} + +// ZonesClientGetResponse contains the response from method ZonesClient.Get. +type ZonesClientGetResponse struct { + // Describes a DNS zone. + Zone +} + +// ZonesClientListByResourceGroupResponse contains the response from method ZonesClient.NewListByResourceGroupPager. +type ZonesClientListByResourceGroupResponse struct { + // The response to a Zone List or ListAll operation. + ZoneListResult +} + +// ZonesClientListResponse contains the response from method ZonesClient.NewListPager. +type ZonesClientListResponse struct { + // The response to a Zone List or ListAll operation. + ZoneListResult +} + +// ZonesClientUpdateResponse contains the response from method ZonesClient.Update. +type ZonesClientUpdateResponse struct { + // Describes a DNS zone. + Zone +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/zones_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/zones_client.go new file mode 100644 index 00000000000..08bdcbf42d9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns/zones_client.go @@ -0,0 +1,452 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdns + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ZonesClient contains the methods for the Zones group. +// Don't use this type directly, use NewZonesClient() instead. +type ZonesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewZonesClient creates a new instance of ZonesClient with the specified values. +// - subscriptionID - Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ZonesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ZonesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a DNS zone. Does not modify DNS records within the zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - parameters - Parameters supplied to the CreateOrUpdate operation. +// - options - ZonesClientCreateOrUpdateOptions contains the optional parameters for the ZonesClient.CreateOrUpdate method. +func (client *ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, options *ZonesClientCreateOrUpdateOptions) (ZonesClientCreateOrUpdateResponse, error) { + var err error + const operationName = "ZonesClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, zoneName, parameters, options) + if err != nil { + return ZonesClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ZonesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ZonesClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ZonesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, options *ZonesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ZonesClient) createOrUpdateHandleResponse(resp *http.Response) (ZonesClientCreateOrUpdateResponse, error) { + result := ZonesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Zone); err != nil { + return ZonesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - ZonesClientBeginDeleteOptions contains the optional parameters for the ZonesClient.BeginDelete method. +func (client *ZonesClient) BeginDelete(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientBeginDeleteOptions) (*runtime.Poller[ZonesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, zoneName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ZonesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ZonesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +func (client *ZonesClient) deleteOperation(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ZonesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, zoneName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ZonesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - options - ZonesClientGetOptions contains the optional parameters for the ZonesClient.Get method. +func (client *ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientGetOptions) (ZonesClientGetResponse, error) { + var err error + const operationName = "ZonesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, zoneName, options) + if err != nil { + return ZonesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ZonesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ZonesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ZonesClient) getCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, options *ZonesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ZonesClient) getHandleResponse(resp *http.Response) (ZonesClientGetResponse, error) { + result := ZonesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Zone); err != nil { + return ZonesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists the DNS zones in all resource groups in a subscription. +// +// Generated from API version 2018-05-01 +// - options - ZonesClientListOptions contains the optional parameters for the ZonesClient.NewListPager method. +func (client *ZonesClient) NewListPager(options *ZonesClientListOptions) *runtime.Pager[ZonesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ZonesClientListResponse]{ + More: func(page ZonesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ZonesClientListResponse) (ZonesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ZonesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return ZonesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ZonesClient) listCreateRequest(ctx context.Context, options *ZonesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Network/dnszones" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ZonesClient) listHandleResponse(resp *http.Response) (ZonesClientListResponse, error) { + result := ZonesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ZoneListResult); err != nil { + return ZonesClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists the DNS zones within a resource group. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - options - ZonesClientListByResourceGroupOptions contains the optional parameters for the ZonesClient.NewListByResourceGroupPager +// method. +func (client *ZonesClient) NewListByResourceGroupPager(resourceGroupName string, options *ZonesClientListByResourceGroupOptions) *runtime.Pager[ZonesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ZonesClientListByResourceGroupResponse]{ + More: func(page ZonesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ZonesClientListByResourceGroupResponse) (ZonesClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ZonesClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return ZonesClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ZonesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ZonesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ZonesClient) listByResourceGroupHandleResponse(resp *http.Response) (ZonesClientListByResourceGroupResponse, error) { + result := ZonesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ZoneListResult); err != nil { + return ZonesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// Update - Updates a DNS zone. Does not modify DNS records within the zone. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2018-05-01 +// - resourceGroupName - The name of the resource group. +// - zoneName - The name of the DNS zone (without a terminating dot). +// - parameters - Parameters supplied to the Update operation. +// - options - ZonesClientUpdateOptions contains the optional parameters for the ZonesClient.Update method. +func (client *ZonesClient) Update(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, options *ZonesClientUpdateOptions) (ZonesClientUpdateResponse, error) { + var err error + const operationName = "ZonesClient.Update" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateCreateRequest(ctx, resourceGroupName, zoneName, parameters, options) + if err != nil { + return ZonesClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ZonesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ZonesClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ZonesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, zoneName string, parameters ZoneUpdate, options *ZonesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if zoneName == "" { + return nil, errors.New("parameter zoneName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{zoneName}", url.PathEscape(zoneName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2018-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ZonesClient) updateHandleResponse(resp *http.Response) (ZonesClientUpdateResponse, error) { + result := ZonesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Zone); err != nil { + return ZonesClientUpdateResponse{}, err + } + return result, nil +} From 153d7d91fcc968a529295e25427cee1c4eef7a8c Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Mon, 10 Jun 2024 17:00:09 -0700 Subject: [PATCH 2/8] remove azidentity --- pkg/deploy/deploy.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/deploy/deploy.go b/pkg/deploy/deploy.go index 75fa2c01d54..4827ecc85c3 100644 --- a/pkg/deploy/deploy.go +++ b/pkg/deploy/deploy.go @@ -10,7 +10,6 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" mgmtfeatures "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features" "github.com/Azure/go-autorest/autorest/azure" "github.com/jongio/azidext/go/azidext" @@ -91,8 +90,6 @@ func New(ctx context.Context, log *logrus.Entry, _env env.Core, config *RPConfig kvAuthorizer := azidext.NewTokenCredentialAdapter(tokenCredential, scopes) vmssClient := compute.NewVirtualMachineScaleSetsClient(_env.Environment(), config.SubscriptionID, authorizer) - options := _env.Environment().EnvironmentCredentialOptions() - spTokenCredential, err := azidentity.NewEnvironmentCredential(options) return &deployer{ log: log, env: _env, From 6b99cfa8e4eaa1aa38df0ee863ef732e4dbe1c17 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Mon, 10 Jun 2024 17:07:41 -0700 Subject: [PATCH 3/8] remove white space --- pkg/deploy/deploy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/deploy/deploy.go b/pkg/deploy/deploy.go index 4827ecc85c3..07ab5f42da5 100644 --- a/pkg/deploy/deploy.go +++ b/pkg/deploy/deploy.go @@ -90,6 +90,7 @@ func New(ctx context.Context, log *logrus.Entry, _env env.Core, config *RPConfig kvAuthorizer := azidext.NewTokenCredentialAdapter(tokenCredential, scopes) vmssClient := compute.NewVirtualMachineScaleSetsClient(_env.Environment(), config.SubscriptionID, authorizer) + return &deployer{ log: log, env: _env, From 6311e81c0eaaec3b715f0352a45850eb881f782f Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Mon, 10 Jun 2024 17:19:56 -0700 Subject: [PATCH 4/8] vendor --- vendor/modules.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/modules.txt b/vendor/modules.txt index 3bc9ff1a2e4..a2ec8417de1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -59,6 +59,9 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/uuid # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 v2.5.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 +# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 +## explicit; go 1.18 +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault From 86b223af273406b073ec9983c794a1c5cc22318a Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Thu, 13 Jun 2024 12:59:38 -0700 Subject: [PATCH 5/8] fix lint --- go.mod | 2 +- .../azureclient/azuresdk/armdns/generate.go | 8 ++++ .../azureclient/azuresdk/armdns/recordsets.go | 3 +- pkg/util/azureclient/azuresdk/armdns/zones.go | 41 +++++++++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 886294533b3..3a303b18802 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v2 v2.5.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/adal v0.9.23 diff --git a/pkg/util/azureclient/azuresdk/armdns/generate.go b/pkg/util/azureclient/azuresdk/armdns/generate.go index cb3c0767e98..c796668d758 100644 --- a/pkg/util/azureclient/azuresdk/armdns/generate.go +++ b/pkg/util/azureclient/azuresdk/armdns/generate.go @@ -1 +1,9 @@ package armdns +package armdns + +// Copyright (c) Microsoft Corporation. +// Licensed under the Apache License 2.0. + +//go:generate rm -rf ../../../../../pkg/util/mocks/azureclient/azuresdk/$GOPACKAGE +//go:generate go run ../../../../../vendor/github.com/golang/mock/mockgen -destination=../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/$GOPACKAGE RecordSetsClient,ZonesClient +//go:generate go run ../../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/Azure/ARO-RP -e -w ../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go \ No newline at end of file diff --git a/pkg/util/azureclient/azuresdk/armdns/recordsets.go b/pkg/util/azureclient/azuresdk/armdns/recordsets.go index 324d2c422b5..150abcf2b11 100644 --- a/pkg/util/azureclient/azuresdk/armdns/recordsets.go +++ b/pkg/util/azureclient/azuresdk/armdns/recordsets.go @@ -8,7 +8,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" sdkdns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" "github.com/Azure/ARO-RP/pkg/util/azureclient" @@ -28,7 +27,7 @@ type recordSetsClient struct { var _ RecordSetsClient = &recordSetsClient{} // NewRecordSetsClient creates a new RecordSetsClient -func NewRecordSetsClient(environment *azureclient.AROEnvironment, subscriptionID string, credential azidentity.EnvironmentCredential) RecordSetsClient { +func NewRecordSetsClient(environment *azureclient.AROEnvironment, subscriptionID string, credential azcore.TokenCredential) RecordSetsClient { options := arm.ClientOptions{ ClientOptions: azcore.ClientOptions{ Cloud: environment.Cloud, diff --git a/pkg/util/azureclient/azuresdk/armdns/zones.go b/pkg/util/azureclient/azuresdk/armdns/zones.go index cb3c0767e98..290b1896dae 100644 --- a/pkg/util/azureclient/azuresdk/armdns/zones.go +++ b/pkg/util/azureclient/azuresdk/armdns/zones.go @@ -1 +1,42 @@ package armdns + +// Copyright (c) Microsoft Corporation. +// Licensed under the Apache License 2.0. + +import ( + "context" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + sdkdns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" + + "github.com/Azure/ARO-RP/pkg/util/azureclient" +) + +// ZonesClient is a minimal interface for azure ZonesClient +type ZonesClient interface { + Get(ctx context.Context, resourceGroupName string, zoneName string, options *sdkdns.ZonesClientGetOptions) (sdkdns.ZonesClientGetResponse, error) +} + +type zonesClient struct { + sdkdns.ZonesClient +} + +var _ ZonesClient = &zonesClient{} + +// NewZonesClient creates a new ZonesClient +func NewZonesClient(environment *azureclient.AROEnvironment, subscriptionID string, credential azcore.TokenCredential) ZonesClient { + options := arm.ClientOptions{ + ClientOptions: azcore.ClientOptions{ + Cloud: environment.Cloud, + }, + } + clientFactory, err := sdkdns.NewClientFactory(subscriptionID, credential, &options) + if err != nil { + return nil + } + client := clientFactory.NewZonesClient() + return &zonesClient{ + ZonesClient: *client, + } +} From 7d0e68da4a43ed149a8b1a3771c08b5840c63329 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Thu, 13 Jun 2024 14:59:25 -0700 Subject: [PATCH 6/8] add mock --- go.sum | 19 +++ .../azureclient/azuresdk/armdns/generate.go | 3 +- .../azureclient/azuresdk/armdns/armdns.go | 119 ++++++++++++++++++ 3 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 pkg/util/mocks/azureclient/azuresdk/armdns/armdns.go diff --git a/go.sum b/go.sum index 70361711711..e7994fb4ab7 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,7 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 h1:SCbEWT58NSt7d2mcFdvxC9uyrdcTfvBbPLThhkDmXzg= +github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774/go.mod h1:6/0dYRLLXyJjbkIPeeGyoJ/eKOSI0eU6eTlCBYibgd0= github.com/Azure/azure-sdk-for-go v63.1.0+incompatible h1:yNC7qlSUWVF8p0TzxdmWW1FJ3DdIA+0Pge41IU/2+9U= github.com/Azure/azure-sdk-for-go v63.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= @@ -63,6 +64,7 @@ github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1o github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= +github.com/ajeddeloh/go-json v0.0.0-20170920214419-6a2fe990e083/go.mod h1:otnto4/Icqn88WCcM4bhIJNSgsh9VLBuspyyCfvof9c= github.com/alvaroloes/enumer v1.1.2 h1:5khqHB33TZy1GWCO/lZwcroBFh7u+0j40T83VUbfAMY= github.com/alvaroloes/enumer v1.1.2/go.mod h1:FxrjvuXoDAx9isTJrv4c+T410zFi0DtXIT0m65DJ+Wo= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -79,6 +81,7 @@ github.com/beevik/etree v1.1.1-0.20200718192613-4a2f8b9d084c/go.mod h1:0yGO2rna3 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -91,6 +94,7 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -114,12 +118,15 @@ github.com/codahale/etm v0.0.0-20141003032925-c00c9e6fb4c9 h1:88tJLy+/ao5kPBv1Et github.com/codahale/etm v0.0.0-20141003032925-c00c9e6fb4c9/go.mod h1:jy75q4Q7stkoOx8bCRnIm0t1Vh6Pt4OJvcwA9+oJsqI= github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= +github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= +github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containers/buildah v1.33.7 h1:Y2kNea+hNNyZ74ppYFWmD0cLc/DwZ5A4NEUPQWPj5Zw= github.com/containers/buildah v1.33.7/go.mod h1:pphfdjrwtTWkuIy1aDyZMEVyMfmm0DsbvxLGxxEU1cM= github.com/containers/common v0.57.4 h1:kmfBad92kUjP5X44BPpOwMe+eZQqaKETfS+ASeL0g+g= @@ -183,6 +190,7 @@ github.com/docker/go-connections v0.4.1-0.20231031175723-0b8c1f4e07a0/go.mod h1: github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -234,6 +242,7 @@ github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7 github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -406,6 +415,7 @@ github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2E github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -476,6 +486,7 @@ github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0 h1:7NWTfyXvOjoizW7PmxNp3+8w github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0/go.mod h1:tQb4q3YMIj2dWhhXhQSJ4ELpol931ANKzHSYK5kX1qE= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mistifyio/go-zfs/v3 v3.0.1 h1:YaoXgBePoMA12+S1u/ddkv+QqxcfiZK4prI6HPnkFiU= github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= @@ -485,6 +496,7 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= @@ -504,9 +516,11 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mtrmac/gpgme v0.1.2/go.mod h1:GYYHnGSuS7HK3zVS2n3y73y0okK/BeKzwnn5jgiVFNI= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -620,6 +634,7 @@ github.com/serge1peshcoff/selenium-go-conditions v0.0.0-20170824121757-5afbdb745 github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sigstore/fulcio v1.4.3 h1:9JcUCZjjVhRF9fmhVuz6i1RyhCc/EGCD7MOl+iqCJLQ= github.com/sigstore/fulcio v1.4.3/go.mod h1:BQPWo7cfxmJwgaHlphUHUpFkp5+YxeJes82oo39m5og= github.com/sigstore/rekor v1.2.2 h1:5JK/zKZvcQpL/jBmHvmFj3YbpDMBQnJQ6ygp8xdF3bY= @@ -650,6 +665,7 @@ github.com/sylabs/sif/v2 v2.15.0 h1:Nv0tzksFnoQiQ2eUwpAis9nVqEu4c3RcNSxX8P3Cecw= github.com/sylabs/sif/v2 v2.15.0/go.mod h1:X1H7eaPz6BAxA84POMESXoXfTqgAnLQkujyF/CQFWTc= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/tchap/go-patricia v2.3.0+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/tebeka/selenium v0.9.9 h1:cNziB+etNgyH/7KlNI7RMC1ua5aH1+5wUlFQyzeMh+w= @@ -677,7 +693,9 @@ github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+ github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= @@ -783,6 +801,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= diff --git a/pkg/util/azureclient/azuresdk/armdns/generate.go b/pkg/util/azureclient/azuresdk/armdns/generate.go index c796668d758..d5dd32797c8 100644 --- a/pkg/util/azureclient/azuresdk/armdns/generate.go +++ b/pkg/util/azureclient/azuresdk/armdns/generate.go @@ -1,9 +1,8 @@ package armdns -package armdns // Copyright (c) Microsoft Corporation. // Licensed under the Apache License 2.0. //go:generate rm -rf ../../../../../pkg/util/mocks/azureclient/azuresdk/$GOPACKAGE //go:generate go run ../../../../../vendor/github.com/golang/mock/mockgen -destination=../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/$GOPACKAGE RecordSetsClient,ZonesClient -//go:generate go run ../../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/Azure/ARO-RP -e -w ../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go \ No newline at end of file +//go:generate go run ../../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/Azure/ARO-RP -e -w ../../../mocks/azureclient/azuresdk/$GOPACKAGE/$GOPACKAGE.go diff --git a/pkg/util/mocks/azureclient/azuresdk/armdns/armdns.go b/pkg/util/mocks/azureclient/azuresdk/armdns/armdns.go new file mode 100644 index 00000000000..47da3d61957 --- /dev/null +++ b/pkg/util/mocks/azureclient/azuresdk/armdns/armdns.go @@ -0,0 +1,119 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/Azure/ARO-RP/pkg/util/azureclient/azuresdk/armdns (interfaces: RecordSetsClient,ZonesClient) + +// Package mock_armdns is a generated GoMock package. +package mock_armdns + +import ( + context "context" + reflect "reflect" + + armdns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" + gomock "github.com/golang/mock/gomock" +) + +// MockRecordSetsClient is a mock of RecordSetsClient interface. +type MockRecordSetsClient struct { + ctrl *gomock.Controller + recorder *MockRecordSetsClientMockRecorder +} + +// MockRecordSetsClientMockRecorder is the mock recorder for MockRecordSetsClient. +type MockRecordSetsClientMockRecorder struct { + mock *MockRecordSetsClient +} + +// NewMockRecordSetsClient creates a new mock instance. +func NewMockRecordSetsClient(ctrl *gomock.Controller) *MockRecordSetsClient { + mock := &MockRecordSetsClient{ctrl: ctrl} + mock.recorder = &MockRecordSetsClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRecordSetsClient) EXPECT() *MockRecordSetsClientMockRecorder { + return m.recorder +} + +// CreateOrUpdate mocks base method. +func (m *MockRecordSetsClient) CreateOrUpdate(arg0 context.Context, arg1, arg2, arg3 string, arg4 armdns.RecordType, arg5 armdns.RecordSet, arg6 *armdns.RecordSetsClientCreateOrUpdateOptions) (armdns.RecordSetsClientCreateOrUpdateResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdate", arg0, arg1, arg2, arg3, arg4, arg5, arg6) + ret0, _ := ret[0].(armdns.RecordSetsClientCreateOrUpdateResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrUpdate indicates an expected call of CreateOrUpdate. +func (mr *MockRecordSetsClientMockRecorder) CreateOrUpdate(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdate", reflect.TypeOf((*MockRecordSetsClient)(nil).CreateOrUpdate), arg0, arg1, arg2, arg3, arg4, arg5, arg6) +} + +// Delete mocks base method. +func (m *MockRecordSetsClient) Delete(arg0 context.Context, arg1, arg2, arg3 string, arg4 armdns.RecordType, arg5 *armdns.RecordSetsClientDeleteOptions) (armdns.RecordSetsClientDeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delete", arg0, arg1, arg2, arg3, arg4, arg5) + ret0, _ := ret[0].(armdns.RecordSetsClientDeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Delete indicates an expected call of Delete. +func (mr *MockRecordSetsClientMockRecorder) Delete(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRecordSetsClient)(nil).Delete), arg0, arg1, arg2, arg3, arg4, arg5) +} + +// Get mocks base method. +func (m *MockRecordSetsClient) Get(arg0 context.Context, arg1, arg2, arg3 string, arg4 armdns.RecordType, arg5 *armdns.RecordSetsClientGetOptions) (armdns.RecordSetsClientGetResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3, arg4, arg5) + ret0, _ := ret[0].(armdns.RecordSetsClientGetResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Get indicates an expected call of Get. +func (mr *MockRecordSetsClientMockRecorder) Get(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockRecordSetsClient)(nil).Get), arg0, arg1, arg2, arg3, arg4, arg5) +} + +// MockZonesClient is a mock of ZonesClient interface. +type MockZonesClient struct { + ctrl *gomock.Controller + recorder *MockZonesClientMockRecorder +} + +// MockZonesClientMockRecorder is the mock recorder for MockZonesClient. +type MockZonesClientMockRecorder struct { + mock *MockZonesClient +} + +// NewMockZonesClient creates a new mock instance. +func NewMockZonesClient(ctrl *gomock.Controller) *MockZonesClient { + mock := &MockZonesClient{ctrl: ctrl} + mock.recorder = &MockZonesClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockZonesClient) EXPECT() *MockZonesClientMockRecorder { + return m.recorder +} + +// Get mocks base method. +func (m *MockZonesClient) Get(arg0 context.Context, arg1, arg2 string, arg3 *armdns.ZonesClientGetOptions) (armdns.ZonesClientGetResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(armdns.ZonesClientGetResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Get indicates an expected call of Get. +func (mr *MockZonesClientMockRecorder) Get(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockZonesClient)(nil).Get), arg0, arg1, arg2, arg3) +} From 001b662e5dc1a904eb17d33a217532adce04e7e1 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Thu, 13 Jun 2024 15:10:40 -0700 Subject: [PATCH 7/8] fix ci --- go.sum | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/go.sum b/go.sum index e7994fb4ab7..70361711711 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,6 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 h1:SCbEWT58NSt7d2mcFdvxC9uyrdcTfvBbPLThhkDmXzg= -github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774/go.mod h1:6/0dYRLLXyJjbkIPeeGyoJ/eKOSI0eU6eTlCBYibgd0= github.com/Azure/azure-sdk-for-go v63.1.0+incompatible h1:yNC7qlSUWVF8p0TzxdmWW1FJ3DdIA+0Pge41IU/2+9U= github.com/Azure/azure-sdk-for-go v63.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= @@ -64,7 +63,6 @@ github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1o github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/ajeddeloh/go-json v0.0.0-20170920214419-6a2fe990e083/go.mod h1:otnto4/Icqn88WCcM4bhIJNSgsh9VLBuspyyCfvof9c= github.com/alvaroloes/enumer v1.1.2 h1:5khqHB33TZy1GWCO/lZwcroBFh7u+0j40T83VUbfAMY= github.com/alvaroloes/enumer v1.1.2/go.mod h1:FxrjvuXoDAx9isTJrv4c+T410zFi0DtXIT0m65DJ+Wo= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -81,7 +79,6 @@ github.com/beevik/etree v1.1.1-0.20200718192613-4a2f8b9d084c/go.mod h1:0yGO2rna3 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -94,7 +91,6 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNSjIRk= github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -118,15 +114,12 @@ github.com/codahale/etm v0.0.0-20141003032925-c00c9e6fb4c9 h1:88tJLy+/ao5kPBv1Et github.com/codahale/etm v0.0.0-20141003032925-c00c9e6fb4c9/go.mod h1:jy75q4Q7stkoOx8bCRnIm0t1Vh6Pt4OJvcwA9+oJsqI= github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.7.11 h1:lfGKw3eU35sjV0aG2eYZTiwFEY1pCzxdzicHP3SZILw= github.com/containerd/containerd v1.7.11/go.mod h1:5UluHxHTX2rdvYuZ5OJTC5m/KJNs0Zs9wVoJm9zf5ZE= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containers/buildah v1.33.7 h1:Y2kNea+hNNyZ74ppYFWmD0cLc/DwZ5A4NEUPQWPj5Zw= github.com/containers/buildah v1.33.7/go.mod h1:pphfdjrwtTWkuIy1aDyZMEVyMfmm0DsbvxLGxxEU1cM= github.com/containers/common v0.57.4 h1:kmfBad92kUjP5X44BPpOwMe+eZQqaKETfS+ASeL0g+g= @@ -190,7 +183,6 @@ github.com/docker/go-connections v0.4.1-0.20231031175723-0b8c1f4e07a0/go.mod h1: github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -242,7 +234,6 @@ github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7 github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -415,7 +406,6 @@ github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2E github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -486,7 +476,6 @@ github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0 h1:7NWTfyXvOjoizW7PmxNp3+8w github.com/microsoftgraph/msgraph-sdk-go-core v1.0.0/go.mod h1:tQb4q3YMIj2dWhhXhQSJ4ELpol931ANKzHSYK5kX1qE= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mistifyio/go-zfs/v3 v3.0.1 h1:YaoXgBePoMA12+S1u/ddkv+QqxcfiZK4prI6HPnkFiU= github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= @@ -496,7 +485,6 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g= @@ -516,11 +504,9 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mtrmac/gpgme v0.1.2/go.mod h1:GYYHnGSuS7HK3zVS2n3y73y0okK/BeKzwnn5jgiVFNI= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -634,7 +620,6 @@ github.com/serge1peshcoff/selenium-go-conditions v0.0.0-20170824121757-5afbdb745 github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sigstore/fulcio v1.4.3 h1:9JcUCZjjVhRF9fmhVuz6i1RyhCc/EGCD7MOl+iqCJLQ= github.com/sigstore/fulcio v1.4.3/go.mod h1:BQPWo7cfxmJwgaHlphUHUpFkp5+YxeJes82oo39m5og= github.com/sigstore/rekor v1.2.2 h1:5JK/zKZvcQpL/jBmHvmFj3YbpDMBQnJQ6ygp8xdF3bY= @@ -665,7 +650,6 @@ github.com/sylabs/sif/v2 v2.15.0 h1:Nv0tzksFnoQiQ2eUwpAis9nVqEu4c3RcNSxX8P3Cecw= github.com/sylabs/sif/v2 v2.15.0/go.mod h1:X1H7eaPz6BAxA84POMESXoXfTqgAnLQkujyF/CQFWTc= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tchap/go-patricia v2.3.0+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/tebeka/selenium v0.9.9 h1:cNziB+etNgyH/7KlNI7RMC1ua5aH1+5wUlFQyzeMh+w= @@ -693,9 +677,7 @@ github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+ github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= @@ -801,7 +783,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= From f7a0a85d32892eabd0d5218a001716238294862d Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Mon, 24 Jun 2024 16:25:01 -0700 Subject: [PATCH 8/8] fix comments --- pkg/util/azureclient/azuresdk/armdns/recordsets.go | 11 ++--------- pkg/util/azureclient/azuresdk/armdns/zones.go | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/pkg/util/azureclient/azuresdk/armdns/recordsets.go b/pkg/util/azureclient/azuresdk/armdns/recordsets.go index 150abcf2b11..13cebdf1c3c 100644 --- a/pkg/util/azureclient/azuresdk/armdns/recordsets.go +++ b/pkg/util/azureclient/azuresdk/armdns/recordsets.go @@ -9,8 +9,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" sdkdns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" - - "github.com/Azure/ARO-RP/pkg/util/azureclient" ) // RecordSetsClient is a minimal interface for azure RecordSetsClient @@ -27,13 +25,8 @@ type recordSetsClient struct { var _ RecordSetsClient = &recordSetsClient{} // NewRecordSetsClient creates a new RecordSetsClient -func NewRecordSetsClient(environment *azureclient.AROEnvironment, subscriptionID string, credential azcore.TokenCredential) RecordSetsClient { - options := arm.ClientOptions{ - ClientOptions: azcore.ClientOptions{ - Cloud: environment.Cloud, - }, - } - clientFactory, err := sdkdns.NewClientFactory(subscriptionID, credential, &options) +func NewRecordSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) RecordSetsClient { + clientFactory, err := sdkdns.NewClientFactory(subscriptionID, credential, options) if err != nil { return nil } diff --git a/pkg/util/azureclient/azuresdk/armdns/zones.go b/pkg/util/azureclient/azuresdk/armdns/zones.go index 290b1896dae..e005fe61777 100644 --- a/pkg/util/azureclient/azuresdk/armdns/zones.go +++ b/pkg/util/azureclient/azuresdk/armdns/zones.go @@ -9,8 +9,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" sdkdns "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns" - - "github.com/Azure/ARO-RP/pkg/util/azureclient" ) // ZonesClient is a minimal interface for azure ZonesClient @@ -25,13 +23,8 @@ type zonesClient struct { var _ ZonesClient = &zonesClient{} // NewZonesClient creates a new ZonesClient -func NewZonesClient(environment *azureclient.AROEnvironment, subscriptionID string, credential azcore.TokenCredential) ZonesClient { - options := arm.ClientOptions{ - ClientOptions: azcore.ClientOptions{ - Cloud: environment.Cloud, - }, - } - clientFactory, err := sdkdns.NewClientFactory(subscriptionID, credential, &options) +func NewZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) ZonesClient { + clientFactory, err := sdkdns.NewClientFactory(subscriptionID, credential, options) if err != nil { return nil }