diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/CHANGELOG.md b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/CHANGELOG.md deleted file mode 100644 index bd0b8e85e4a2..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/CHANGELOG.md +++ /dev/null @@ -1,184 +0,0 @@ -# Release History - -## 0.4.0 (2024-08-22) -### Breaking Changes - -- Field `ClusterIdentity` of struct `KafkaProfile` has been removed - -### Features Added - -- New value `ClusterAvailableUpgradeTypePatchVersionUpgrade` added to enum type `ClusterAvailableUpgradeType` -- New value `ClusterUpgradeTypePatchVersionUpgrade` added to enum type `ClusterUpgradeType` -- New enum type `Category` with values `CategoryCustom`, `CategoryPredefined` -- New enum type `ClusterPoolUpgradeHistoryType` with values `ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade`, `ClusterPoolUpgradeHistoryTypeNodeOsUpgrade` -- New enum type `ClusterPoolUpgradeHistoryUpgradeResultType` with values `ClusterPoolUpgradeHistoryUpgradeResultTypeFailed`, `ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed` -- New enum type `ClusterUpgradeHistorySeverityType` with values `ClusterUpgradeHistorySeverityTypeCritical`, `ClusterUpgradeHistorySeverityTypeHigh`, `ClusterUpgradeHistorySeverityTypeLow`, `ClusterUpgradeHistorySeverityTypeMedium` -- New enum type `ClusterUpgradeHistoryType` with values `ClusterUpgradeHistoryTypeAKSPatchUpgrade`, `ClusterUpgradeHistoryTypeHotfixUpgrade`, `ClusterUpgradeHistoryTypeHotfixUpgradeRollback`, `ClusterUpgradeHistoryTypePatchVersionUpgrade`, `ClusterUpgradeHistoryTypePatchVersionUpgradeRollback` -- New enum type `ClusterUpgradeHistoryUpgradeResultType` with values `ClusterUpgradeHistoryUpgradeResultTypeFailed`, `ClusterUpgradeHistoryUpgradeResultTypeSucceed` -- New enum type `LibraryManagementAction` with values `LibraryManagementActionInstall`, `LibraryManagementActionUninstall` -- New enum type `ManagedIdentityType` with values `ManagedIdentityTypeCluster`, `ManagedIdentityTypeInternal`, `ManagedIdentityTypeUser` -- New enum type `Status` with values `StatusINSTALLED`, `StatusINSTALLFAILED`, `StatusINSTALLING`, `StatusUNINSTALLFAILED`, `StatusUNINSTALLING` -- New enum type `Type` with values `TypeMaven`, `TypePypi` -- New function `*ClientFactory.NewClusterLibrariesClient() *ClusterLibrariesClient` -- New function `*ClientFactory.NewClusterPoolUpgradeHistoriesClient() *ClusterPoolUpgradeHistoriesClient` -- New function `*ClientFactory.NewClusterUpgradeHistoriesClient() *ClusterUpgradeHistoriesClient` -- New function `*ClusterAksPatchUpgradeHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClusterAvailableInPlaceUpgradeProperties.GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties` -- New function `*ClusterAvailableInPlaceUpgradeProperties.GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties` -- New function `*ClusterAvailableUpgradeHotfixUpgradeProperties.GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties` -- New function `*ClusterAvailableUpgradePatchVersionUpgradeProperties.GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties` -- New function `*ClusterAvailableUpgradePatchVersionUpgradeProperties.GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties` -- New function `*ClusterHotfixUpgradeHistoryProperties.GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties` -- New function `*ClusterHotfixUpgradeHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClusterHotfixUpgradeProperties.GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties` -- New function `*ClusterHotfixUpgradeRollbackHistoryProperties.GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties` -- New function `*ClusterHotfixUpgradeRollbackHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClusterInPlaceUpgradeHistoryProperties.GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties` -- New function `*ClusterInPlaceUpgradeHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClusterInPlaceUpgradeProperties.GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties` -- New function `*ClusterInPlaceUpgradeProperties.GetClusterUpgradeProperties() *ClusterUpgradeProperties` -- New function `NewClusterLibrariesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterLibrariesClient, error)` -- New function `*ClusterLibrariesClient.NewListPager(string, string, string, Category, *ClusterLibrariesClientListOptions) *runtime.Pager[ClusterLibrariesClientListResponse]` -- New function `*ClusterLibrariesClient.BeginManageLibraries(context.Context, string, string, string, ClusterLibraryManagementOperation, *ClusterLibrariesClientBeginManageLibrariesOptions) (*runtime.Poller[ClusterLibrariesClientManageLibrariesResponse], error)` -- New function `*ClusterLibraryProperties.GetClusterLibraryProperties() *ClusterLibraryProperties` -- New function `*ClusterPatchVersionUpgradeHistoryProperties.GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties` -- New function `*ClusterPatchVersionUpgradeHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClusterPatchVersionUpgradeProperties.GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties` -- New function `*ClusterPatchVersionUpgradeProperties.GetClusterUpgradeProperties() *ClusterUpgradeProperties` -- New function `*ClusterPatchVersionUpgradeRollbackHistoryProperties.GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties` -- New function `*ClusterPatchVersionUpgradeRollbackHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClusterPoolAksPatchUpgradeHistoryProperties.GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties` -- New function `*ClusterPoolNodeOsUpgradeHistoryProperties.GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties` -- New function `NewClusterPoolUpgradeHistoriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterPoolUpgradeHistoriesClient, error)` -- New function `*ClusterPoolUpgradeHistoriesClient.NewListPager(string, string, *ClusterPoolUpgradeHistoriesClientListOptions) *runtime.Pager[ClusterPoolUpgradeHistoriesClientListResponse]` -- New function `*ClusterPoolUpgradeHistoryProperties.GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties` -- New function `NewClusterUpgradeHistoriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterUpgradeHistoriesClient, error)` -- New function `*ClusterUpgradeHistoriesClient.NewListPager(string, string, string, *ClusterUpgradeHistoriesClientListOptions) *runtime.Pager[ClusterUpgradeHistoriesClientListResponse]` -- New function `*ClusterUpgradeHistoryProperties.GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties` -- New function `*ClustersClient.BeginUpgradeManualRollback(context.Context, string, string, string, ClusterUpgradeRollback, *ClustersClientBeginUpgradeManualRollbackOptions) (*runtime.Poller[ClustersClientUpgradeManualRollbackResponse], error)` -- New function `*MavenLibraryProperties.GetClusterLibraryProperties() *ClusterLibraryProperties` -- New function `*PyPiLibraryProperties.GetClusterLibraryProperties() *ClusterLibraryProperties` -- New struct `ClusterAksPatchUpgradeHistoryProperties` -- New struct `ClusterAvailableUpgradePatchVersionUpgradeProperties` -- New struct `ClusterHotfixUpgradeHistoryProperties` -- New struct `ClusterHotfixUpgradeRollbackHistoryProperties` -- New struct `ClusterLibrary` -- New struct `ClusterLibraryList` -- New struct `ClusterLibraryManagementOperation` -- New struct `ClusterLibraryManagementOperationProperties` -- New struct `ClusterPatchVersionUpgradeHistoryProperties` -- New struct `ClusterPatchVersionUpgradeProperties` -- New struct `ClusterPatchVersionUpgradeRollbackHistoryProperties` -- New struct `ClusterPoolAksPatchUpgradeHistoryProperties` -- New struct `ClusterPoolNodeOsUpgradeHistoryProperties` -- New struct `ClusterPoolUpgradeHistory` -- New struct `ClusterPoolUpgradeHistoryListResult` -- New struct `ClusterUpgradeHistory` -- New struct `ClusterUpgradeHistoryListResult` -- New struct `ClusterUpgradeRollback` -- New struct `ClusterUpgradeRollbackProperties` -- New struct `IPTag` -- New struct `ManagedIdentityProfile` -- New struct `ManagedIdentitySpec` -- New struct `MavenLibraryProperties` -- New struct `PyPiLibraryProperties` -- New field `PublicIPTag` in struct `ClusterPoolResourcePropertiesClusterPoolProfile` -- New field `AvailabilityZones` in struct `ClusterPoolResourcePropertiesComputeProfile` -- New field `ManagedIdentityProfile` in struct `ClusterProfile` -- New field `AvailabilityZones` in struct `ComputeProfile` -- New field `VMSize` in struct `SSHProfile` -- New field `SecretsProfile`, `TrinoProfile` in struct `UpdatableClusterProfile` - - -## 0.3.0 (2024-04-26) -### Breaking Changes - -- Type of `ClusterProfile.KafkaProfile` has been changed from `map[string]any` to `*KafkaProfile` -- Field `ID`, `Location`, `Name`, `SystemData`, `Type` of struct `ClusterPatch` has been removed - -### Features Added - -- New value `ActionLASTSTATEUPDATE`, `ActionRELAUNCH` added to enum type `Action` -- New enum type `ClusterAvailableUpgradeType` with values `ClusterAvailableUpgradeTypeAKSPatchUpgrade`, `ClusterAvailableUpgradeTypeHotfixUpgrade` -- New enum type `ClusterPoolAvailableUpgradeType` with values `ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade`, `ClusterPoolAvailableUpgradeTypeNodeOsUpgrade` -- New enum type `ClusterPoolUpgradeType` with values `ClusterPoolUpgradeTypeAKSPatchUpgrade`, `ClusterPoolUpgradeTypeNodeOsUpgrade` -- New enum type `ClusterUpgradeType` with values `ClusterUpgradeTypeAKSPatchUpgrade`, `ClusterUpgradeTypeHotfixUpgrade` -- New enum type `CurrentClusterAksVersionStatus` with values `CurrentClusterAksVersionStatusDeprecated`, `CurrentClusterAksVersionStatusSupported` -- New enum type `CurrentClusterPoolAksVersionStatus` with values `CurrentClusterPoolAksVersionStatusDeprecated`, `CurrentClusterPoolAksVersionStatusSupported` -- New enum type `DataDiskType` with values `DataDiskTypePremiumSSDLRS`, `DataDiskTypePremiumSSDV2LRS`, `DataDiskTypePremiumSSDZRS`, `DataDiskTypeStandardHDDLRS`, `DataDiskTypeStandardSSDLRS`, `DataDiskTypeStandardSSDZRS` -- New enum type `DbConnectionAuthenticationMode` with values `DbConnectionAuthenticationModeIdentityAuth`, `DbConnectionAuthenticationModeSQLAuth` -- New enum type `DeploymentMode` with values `DeploymentModeApplication`, `DeploymentModeSession` -- New enum type `MetastoreDbConnectionAuthenticationMode` with values `MetastoreDbConnectionAuthenticationModeIdentityAuth`, `MetastoreDbConnectionAuthenticationModeSQLAuth` -- New enum type `OutboundType` with values `OutboundTypeLoadBalancer`, `OutboundTypeUserDefinedRouting` -- New enum type `RangerUsersyncMode` with values `RangerUsersyncModeAutomatic`, `RangerUsersyncModeStatic` -- New enum type `Severity` with values `SeverityCritical`, `SeverityHigh`, `SeverityLow`, `SeverityMedium` -- New enum type `UpgradeMode` with values `UpgradeModeLASTSTATEUPDATE`, `UpgradeModeSTATELESSUPDATE`, `UpgradeModeUPDATE` -- New function `*ClientFactory.NewClusterAvailableUpgradesClient() *ClusterAvailableUpgradesClient` -- New function `*ClientFactory.NewClusterPoolAvailableUpgradesClient() *ClusterPoolAvailableUpgradesClient` -- New function `*ClusterAKSPatchVersionUpgradeProperties.GetClusterUpgradeProperties() *ClusterUpgradeProperties` -- New function `*ClusterAvailableUpgradeAksPatchUpgradeProperties.GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties` -- New function `*ClusterAvailableUpgradeHotfixUpgradeProperties.GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties` -- New function `*ClusterAvailableUpgradeProperties.GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties` -- New function `NewClusterAvailableUpgradesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterAvailableUpgradesClient, error)` -- New function `*ClusterAvailableUpgradesClient.NewListPager(string, string, string, *ClusterAvailableUpgradesClientListOptions) *runtime.Pager[ClusterAvailableUpgradesClientListResponse]` -- New function `*ClusterHotfixUpgradeProperties.GetClusterUpgradeProperties() *ClusterUpgradeProperties` -- New function `*ClusterPoolAKSPatchVersionUpgradeProperties.GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties` -- New function `*ClusterPoolAvailableUpgradeAksPatchUpgradeProperties.GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties` -- New function `*ClusterPoolAvailableUpgradeNodeOsUpgradeProperties.GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties` -- New function `*ClusterPoolAvailableUpgradeProperties.GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties` -- New function `NewClusterPoolAvailableUpgradesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ClusterPoolAvailableUpgradesClient, error)` -- New function `*ClusterPoolAvailableUpgradesClient.NewListPager(string, string, *ClusterPoolAvailableUpgradesClientListOptions) *runtime.Pager[ClusterPoolAvailableUpgradesClientListResponse]` -- New function `*ClusterPoolNodeOsImageUpdateProperties.GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties` -- New function `*ClusterPoolUpgradeProperties.GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties` -- New function `*ClusterPoolsClient.BeginUpgrade(context.Context, string, string, ClusterPoolUpgrade, *ClusterPoolsClientBeginUpgradeOptions) (*runtime.Poller[ClusterPoolsClientUpgradeResponse], error)` -- New function `*ClusterUpgradeProperties.GetClusterUpgradeProperties() *ClusterUpgradeProperties` -- New function `*ClustersClient.BeginUpgrade(context.Context, string, string, string, ClusterUpgrade, *ClustersClientBeginUpgradeOptions) (*runtime.Poller[ClustersClientUpgradeResponse], error)` -- New struct `ClusterAKSPatchVersionUpgradeProperties` -- New struct `ClusterAccessProfile` -- New struct `ClusterAvailableUpgrade` -- New struct `ClusterAvailableUpgradeAksPatchUpgradeProperties` -- New struct `ClusterAvailableUpgradeHotfixUpgradeProperties` -- New struct `ClusterAvailableUpgradeList` -- New struct `ClusterHotfixUpgradeProperties` -- New struct `ClusterPoolAKSPatchVersionUpgradeProperties` -- New struct `ClusterPoolAvailableUpgrade` -- New struct `ClusterPoolAvailableUpgradeAksPatchUpgradeProperties` -- New struct `ClusterPoolAvailableUpgradeList` -- New struct `ClusterPoolAvailableUpgradeNodeOsUpgradeProperties` -- New struct `ClusterPoolNodeOsImageUpdateProperties` -- New struct `ClusterPoolUpgrade` -- New struct `ClusterRangerPluginProfile` -- New struct `ClusterUpgrade` -- New struct `DiskStorageProfile` -- New struct `FlinkJobProfile` -- New struct `KafkaConnectivityEndpoints` -- New struct `KafkaProfile` -- New struct `RangerAdminSpec` -- New struct `RangerAdminSpecDatabase` -- New struct `RangerAuditSpec` -- New struct `RangerProfile` -- New struct `RangerUsersyncSpec` -- New field `Filter` in struct `ClusterJobsClientListOptions` -- New field `APIServerAuthorizedIPRanges`, `EnablePrivateAPIServer`, `OutboundType` in struct `ClusterPoolResourcePropertiesNetworkProfile` -- New field `ClusterAccessProfile`, `RangerPluginProfile`, `RangerProfile` in struct `ClusterProfile` -- New field `PrivateFqdn` in struct `ConnectivityProfileWeb` -- New field `MetastoreDbConnectionAuthenticationMode` in struct `FlinkHiveCatalogOption` -- New field `RunID` in struct `FlinkJobProperties` -- New field `DeploymentMode`, `JobSpec` in struct `FlinkProfile` -- New field `MetastoreDbConnectionAuthenticationMode` in struct `HiveCatalogOption` -- New field `PrivateSSHEndpoint` in struct `SSHConnectivityEndpoint` -- New field `DbConnectionAuthenticationMode` in struct `SparkMetastoreSpec` -- New field `RangerPluginProfile`, `RangerProfile` in struct `UpdatableClusterProfile` - - -## 0.2.0 (2023-11-24) -### Features Added - -- Support for test fakes and OpenTelemetry trace spans. - - -## 0.1.0 (2023-08-25) - -The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). - -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/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/LICENSE.txt b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/LICENSE.txt deleted file mode 100644 index dc0c2ffb3dc1..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -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/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/README.md b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/README.md deleted file mode 100644 index 6420fa059f69..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Azure Hdinsight Containers Module for Go - -The `armhdinsightcontainers` module provides operations for working with Azure Hdinsight Containers. - -[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers) - -# Getting started - -## Prerequisites - -- an [Azure subscription](https://azure.microsoft.com/free/) -- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go (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 Hdinsight Containers module: - -```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers -``` - -## Authorization - -When creating a client, you will need to provide a credential for authenticating with Azure Hdinsight Containers. 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 Hdinsight Containers 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 := armhdinsightcontainers.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 := armhdinsightcontainers.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.NewAvailableClusterPoolVersionsClient() -``` - -## 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 `Hdinsight Containers` 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. diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/autorest.md b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/autorest.md deleted file mode 100644 index f08ea6615e05..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 -tag: package-preview-2024-05 -``` \ No newline at end of file diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterpoolversions_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterpoolversions_client.go deleted file mode 100644 index 78f06bb2b9f4..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterpoolversions_client.go +++ /dev/null @@ -1,104 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// AvailableClusterPoolVersionsClient contains the methods for the AvailableClusterPoolVersions group. -// Don't use this type directly, use NewAvailableClusterPoolVersionsClient() instead. -type AvailableClusterPoolVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAvailableClusterPoolVersionsClient creates a new instance of AvailableClusterPoolVersionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAvailableClusterPoolVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableClusterPoolVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AvailableClusterPoolVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListByLocationPager - Returns a list of available cluster pool versions. -// -// Generated from API version 2024-05-01-preview -// - location - The name of the Azure region. -// - options - AvailableClusterPoolVersionsClientListByLocationOptions contains the optional parameters for the AvailableClusterPoolVersionsClient.NewListByLocationPager -// method. -func (client *AvailableClusterPoolVersionsClient) NewListByLocationPager(location string, options *AvailableClusterPoolVersionsClientListByLocationOptions) *runtime.Pager[AvailableClusterPoolVersionsClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableClusterPoolVersionsClientListByLocationResponse]{ - More: func(page AvailableClusterPoolVersionsClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableClusterPoolVersionsClientListByLocationResponse) (AvailableClusterPoolVersionsClientListByLocationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailableClusterPoolVersionsClient.NewListByLocationPager") - 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.listByLocationCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return AvailableClusterPoolVersionsClientListByLocationResponse{}, err - } - return client.listByLocationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *AvailableClusterPoolVersionsClient) listByLocationCreateRequest(ctx context.Context, location string, options *AvailableClusterPoolVersionsClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/availableClusterPoolVersions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *AvailableClusterPoolVersionsClient) listByLocationHandleResponse(resp *http.Response) (AvailableClusterPoolVersionsClientListByLocationResponse, error) { - result := AvailableClusterPoolVersionsClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterPoolVersionsListResult); err != nil { - return AvailableClusterPoolVersionsClientListByLocationResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterpoolversions_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterpoolversions_client_example_test.go deleted file mode 100644 index dad118654ba5..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterpoolversions_client_example_test.go +++ /dev/null @@ -1,73 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListAvailableClusterPoolVersions.json -func ExampleAvailableClusterPoolVersionsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableClusterPoolVersionsClient().NewListByLocationPager("westus2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterPoolVersionsListResult = armhdinsightcontainers.ClusterPoolVersionsListResult{ - // Value: []*armhdinsightcontainers.ClusterPoolVersion{ - // { - // Name: to.Ptr("1.0"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HDInsight/locations/westus2/availableclusterpoolversions/1.0"), - // Properties: &armhdinsightcontainers.ClusterPoolVersionProperties{ - // AksVersion: to.Ptr("1.24"), - // ClusterPoolVersion: to.Ptr("1.0"), - // IsPreview: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("1.1"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HDInsight/locations/westus2/availableclusterpoolversions/1.1"), - // Properties: &armhdinsightcontainers.ClusterPoolVersionProperties{ - // AksVersion: to.Ptr("1.25"), - // ClusterPoolVersion: to.Ptr("1.1"), - // IsPreview: to.Ptr(false), - // }, - // }, - // { - // Name: to.Ptr("1.2"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HDInsight/locations/westus2/availableclusterpoolversions/1.2"), - // Properties: &armhdinsightcontainers.ClusterPoolVersionProperties{ - // AksVersion: to.Ptr("1.26"), - // ClusterPoolVersion: to.Ptr("1.2"), - // IsPreview: to.Ptr(true), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterversions_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterversions_client.go deleted file mode 100644 index 667e66ea977f..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterversions_client.go +++ /dev/null @@ -1,104 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// AvailableClusterVersionsClient contains the methods for the AvailableClusterVersions group. -// Don't use this type directly, use NewAvailableClusterVersionsClient() instead. -type AvailableClusterVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAvailableClusterVersionsClient creates a new instance of AvailableClusterVersionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAvailableClusterVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableClusterVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AvailableClusterVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListByLocationPager - Returns a list of available cluster versions. -// -// Generated from API version 2024-05-01-preview -// - location - The name of the Azure region. -// - options - AvailableClusterVersionsClientListByLocationOptions contains the optional parameters for the AvailableClusterVersionsClient.NewListByLocationPager -// method. -func (client *AvailableClusterVersionsClient) NewListByLocationPager(location string, options *AvailableClusterVersionsClientListByLocationOptions) *runtime.Pager[AvailableClusterVersionsClientListByLocationResponse] { - return runtime.NewPager(runtime.PagingHandler[AvailableClusterVersionsClientListByLocationResponse]{ - More: func(page AvailableClusterVersionsClientListByLocationResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AvailableClusterVersionsClientListByLocationResponse) (AvailableClusterVersionsClientListByLocationResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailableClusterVersionsClient.NewListByLocationPager") - 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.listByLocationCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return AvailableClusterVersionsClientListByLocationResponse{}, err - } - return client.listByLocationHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByLocationCreateRequest creates the ListByLocation request. -func (client *AvailableClusterVersionsClient) listByLocationCreateRequest(ctx context.Context, location string, options *AvailableClusterVersionsClientListByLocationOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/availableClusterVersions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByLocationHandleResponse handles the ListByLocation response. -func (client *AvailableClusterVersionsClient) listByLocationHandleResponse(resp *http.Response) (AvailableClusterVersionsClientListByLocationResponse, error) { - result := AvailableClusterVersionsClientListByLocationResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterVersionsListResult); err != nil { - return AvailableClusterVersionsClientListByLocationResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterversions_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterversions_client_example_test.go deleted file mode 100644 index da5c0c95e858..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/availableclusterversions_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListAvailableClusterVersions.json -func ExampleAvailableClusterVersionsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableClusterVersionsClient().NewListByLocationPager("westus2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterVersionsListResult = armhdinsightcontainers.ClusterVersionsListResult{ - // Value: []*armhdinsightcontainers.ClusterVersion{ - // { - // Name: to.Ptr("flink_1.16.0-1.0.4"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HDInsight/locations/westus2/availableclusterversions/flink_1.16.0-1.0.4"), - // Properties: &armhdinsightcontainers.ClusterVersionProperties{ - // ClusterPoolVersion: to.Ptr("1.0"), - // ClusterType: to.Ptr("Flink"), - // ClusterVersion: to.Ptr("1.0.4"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("TaskManager"), - // Version: to.Ptr("1.16.0"), - // }, - // { - // Name: to.Ptr("JobManager"), - // Version: to.Ptr("1.16.0"), - // }}, - // IsPreview: to.Ptr(false), - // OssVersion: to.Ptr("1.16.0"), - // }, - // }, - // { - // Name: to.Ptr("spark_3.3.1-1.0.4"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HDInsight/locations/westus2/availableclusterversions/spark_3.3.1-1.0.4"), - // Properties: &armhdinsightcontainers.ClusterVersionProperties{ - // ClusterPoolVersion: to.Ptr("1.0"), - // ClusterType: to.Ptr("Spark"), - // ClusterVersion: to.Ptr("1.0.4"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("Hadoop"), - // Version: to.Ptr("3.2.3"), - // }, - // { - // Name: to.Ptr("Hive"), - // Version: to.Ptr("3.1.4"), - // }}, - // IsPreview: to.Ptr(false), - // OssVersion: to.Ptr("3.3.1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/build.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/build.go deleted file mode 100644 index ff65dac55a0b..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// 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 -alwaysSetBodyParamRequired -removeUnreferencedTypes resourcemanager/hdinsightcontainers/armhdinsightcontainers - -package armhdinsightcontainers diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/ci.yml b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/ci.yml deleted file mode 100644 index 3351127210a7..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/ci.yml +++ /dev/null @@ -1,27 +0,0 @@ -# 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/hdinsightcontainers/armhdinsightcontainers/ - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/ - -extends: - template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml - parameters: - ServiceDirectory: 'resourcemanager/hdinsightcontainers/armhdinsightcontainers' diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/client_factory.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/client_factory.go deleted file mode 100644 index fd964a72878f..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/client_factory.go +++ /dev/null @@ -1,132 +0,0 @@ -//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 armhdinsightcontainers - -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 - internal *arm.Client -} - -// 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 - The ID of the target subscription. The value must be an UUID. -// - 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) { - internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - return &ClientFactory{ - subscriptionID: subscriptionID, - internal: internal, - }, nil -} - -// NewAvailableClusterPoolVersionsClient creates a new instance of AvailableClusterPoolVersionsClient. -func (c *ClientFactory) NewAvailableClusterPoolVersionsClient() *AvailableClusterPoolVersionsClient { - return &AvailableClusterPoolVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewAvailableClusterVersionsClient creates a new instance of AvailableClusterVersionsClient. -func (c *ClientFactory) NewAvailableClusterVersionsClient() *AvailableClusterVersionsClient { - return &AvailableClusterVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterAvailableUpgradesClient creates a new instance of ClusterAvailableUpgradesClient. -func (c *ClientFactory) NewClusterAvailableUpgradesClient() *ClusterAvailableUpgradesClient { - return &ClusterAvailableUpgradesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterJobsClient creates a new instance of ClusterJobsClient. -func (c *ClientFactory) NewClusterJobsClient() *ClusterJobsClient { - return &ClusterJobsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterLibrariesClient creates a new instance of ClusterLibrariesClient. -func (c *ClientFactory) NewClusterLibrariesClient() *ClusterLibrariesClient { - return &ClusterLibrariesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterPoolAvailableUpgradesClient creates a new instance of ClusterPoolAvailableUpgradesClient. -func (c *ClientFactory) NewClusterPoolAvailableUpgradesClient() *ClusterPoolAvailableUpgradesClient { - return &ClusterPoolAvailableUpgradesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterPoolUpgradeHistoriesClient creates a new instance of ClusterPoolUpgradeHistoriesClient. -func (c *ClientFactory) NewClusterPoolUpgradeHistoriesClient() *ClusterPoolUpgradeHistoriesClient { - return &ClusterPoolUpgradeHistoriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterPoolsClient creates a new instance of ClusterPoolsClient. -func (c *ClientFactory) NewClusterPoolsClient() *ClusterPoolsClient { - return &ClusterPoolsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClusterUpgradeHistoriesClient creates a new instance of ClusterUpgradeHistoriesClient. -func (c *ClientFactory) NewClusterUpgradeHistoriesClient() *ClusterUpgradeHistoriesClient { - return &ClusterUpgradeHistoriesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewClustersClient creates a new instance of ClustersClient. -func (c *ClientFactory) NewClustersClient() *ClustersClient { - return &ClustersClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewLocationsClient creates a new instance of LocationsClient. -func (c *ClientFactory) NewLocationsClient() *LocationsClient { - return &LocationsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewOperationsClient creates a new instance of OperationsClient. -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - return &OperationsClient{ - internal: c.internal, - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusteravailableupgrades_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusteravailableupgrades_client.go deleted file mode 100644 index cd31011c9601..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusteravailableupgrades_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterAvailableUpgradesClient contains the methods for the ClusterAvailableUpgrades group. -// Don't use this type directly, use NewClusterAvailableUpgradesClient() instead. -type ClusterAvailableUpgradesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterAvailableUpgradesClient creates a new instance of ClusterAvailableUpgradesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterAvailableUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterAvailableUpgradesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterAvailableUpgradesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List a cluster available upgrade. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClusterAvailableUpgradesClientListOptions contains the optional parameters for the ClusterAvailableUpgradesClient.NewListPager -// method. -func (client *ClusterAvailableUpgradesClient) NewListPager(resourceGroupName string, clusterPoolName string, clusterName string, options *ClusterAvailableUpgradesClientListOptions) *runtime.Pager[ClusterAvailableUpgradesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterAvailableUpgradesClientListResponse]{ - More: func(page ClusterAvailableUpgradesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterAvailableUpgradesClientListResponse) (ClusterAvailableUpgradesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterAvailableUpgradesClient.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, resourceGroupName, clusterPoolName, clusterName, options) - }, nil) - if err != nil { - return ClusterAvailableUpgradesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ClusterAvailableUpgradesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClusterAvailableUpgradesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/availableUpgrades" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ClusterAvailableUpgradesClient) listHandleResponse(resp *http.Response) (ClusterAvailableUpgradesClientListResponse, error) { - result := ClusterAvailableUpgradesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterAvailableUpgradeList); err != nil { - return ClusterAvailableUpgradesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusteravailableupgrades_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusteravailableupgrades_client_example_test.go deleted file mode 100644 index 7cb799079739..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusteravailableupgrades_client_example_test.go +++ /dev/null @@ -1,72 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterAvailableUpgrades.json -func ExampleClusterAvailableUpgradesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterAvailableUpgradesClient().NewListPager("hiloResourcegroup", "clusterpool1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterAvailableUpgradeList = armhdinsightcontainers.ClusterAvailableUpgradeList{ - // Value: []*armhdinsightcontainers.ClusterAvailableUpgrade{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1/availableUpgrades/AKSPatchUpgrade"), - // Properties: &armhdinsightcontainers.ClusterAvailableUpgradeAksPatchUpgradeProperties{ - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterAvailableUpgradeTypeAKSPatchUpgrade), - // CurrentVersion: to.Ptr("1.26.3"), - // CurrentVersionStatus: to.Ptr(armhdinsightcontainers.CurrentClusterAksVersionStatusSupported), - // LatestVersion: to.Ptr("1.26.6"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1/availableUpgrades/hotfix1"), - // Properties: &armhdinsightcontainers.ClusterAvailableUpgradeHotfixUpgradeProperties{ - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterAvailableUpgradeTypeHotfixUpgrade), - // Description: to.Ptr("Hotfix for historyserver on version 1.16.0-1.0.6.2"), - // ComponentName: to.Ptr("historyserver"), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-29T14:13:12.000Z"); return t}()), - // ExtendedProperties: to.Ptr(""), - // Severity: to.Ptr(armhdinsightcontainers.SeverityLow), - // SourceBuildNumber: to.Ptr("2"), - // SourceClusterVersion: to.Ptr("1.0.6"), - // SourceOssVersion: to.Ptr("1.16.0"), - // TargetBuildNumber: to.Ptr("3"), - // TargetClusterVersion: to.Ptr("1.0.6"), - // TargetOssVersion: to.Ptr("1.16.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterjobs_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterjobs_client.go deleted file mode 100644 index 8e9fb16759ed..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterjobs_client.go +++ /dev/null @@ -1,201 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterJobsClient contains the methods for the ClusterJobs group. -// Don't use this type directly, use NewClusterJobsClient() instead. -type ClusterJobsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterJobsClient creates a new instance of ClusterJobsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterJobsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterJobsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Get jobs of HDInsight on AKS cluster. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClusterJobsClientListOptions contains the optional parameters for the ClusterJobsClient.NewListPager method. -func (client *ClusterJobsClient) NewListPager(resourceGroupName string, clusterPoolName string, clusterName string, options *ClusterJobsClientListOptions) *runtime.Pager[ClusterJobsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterJobsClientListResponse]{ - More: func(page ClusterJobsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterJobsClientListResponse) (ClusterJobsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterJobsClient.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, resourceGroupName, clusterPoolName, clusterName, options) - }, nil) - if err != nil { - return ClusterJobsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ClusterJobsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClusterJobsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/jobs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ClusterJobsClient) listHandleResponse(resp *http.Response) (ClusterJobsClientListResponse, error) { - result := ClusterJobsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterJobList); err != nil { - return ClusterJobsClientListResponse{}, err - } - return result, nil -} - -// BeginRunJob - Operations on jobs of HDInsight on AKS cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - clusterJob - The Cluster job. -// - options - ClusterJobsClientBeginRunJobOptions contains the optional parameters for the ClusterJobsClient.BeginRunJob method. -func (client *ClusterJobsClient) BeginRunJob(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterJob ClusterJob, options *ClusterJobsClientBeginRunJobOptions) (*runtime.Poller[ClusterJobsClientRunJobResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.runJob(ctx, resourceGroupName, clusterPoolName, clusterName, clusterJob, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClusterJobsClientRunJobResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClusterJobsClientRunJobResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// RunJob - Operations on jobs of HDInsight on AKS cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClusterJobsClient) runJob(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterJob ClusterJob, options *ClusterJobsClientBeginRunJobOptions) (*http.Response, error) { - var err error - const operationName = "ClusterJobsClient.BeginRunJob" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.runJobCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, clusterJob, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// runJobCreateRequest creates the RunJob request. -func (client *ClusterJobsClient) runJobCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterJob ClusterJob, options *ClusterJobsClientBeginRunJobOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/runJob" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterJob); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterjobs_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterjobs_client_example_test.go deleted file mode 100644 index 84a6b06e7122..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterjobs_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/RunClusterJob.json -func ExampleClusterJobsClient_BeginRunJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterJobsClient().BeginRunJob(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterJob{ - Properties: &armhdinsightcontainers.FlinkJobProperties{ - JobType: to.Ptr(armhdinsightcontainers.JobTypeFlinkJob), - Action: to.Ptr(armhdinsightcontainers.ActionSTART), - EntryClass: to.Ptr("com.microsoft.hilo.flink.job.streaming.SleepJob"), - FlinkConfiguration: map[string]*string{ - "parallelism": to.Ptr("1"), - "savepoint.directory": to.Ptr("abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint"), - }, - JarName: to.Ptr("flink-sleep-job-0.0.1-SNAPSHOT.jar"), - JobJarDirectory: to.Ptr("abfs://flinkjob@hilosa.dfs.core.windows.net/jars"), - JobName: to.Ptr("flink-job-name"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterJob = armhdinsightcontainers.ClusterJob{ - // Properties: &armhdinsightcontainers.FlinkJobProperties{ - // JobType: to.Ptr(armhdinsightcontainers.JobTypeFlinkJob), - // Action: to.Ptr(armhdinsightcontainers.ActionSTART), - // EntryClass: to.Ptr("com.microsoft.hilo.flink.job.streaming.SleepJob"), - // FlinkConfiguration: map[string]*string{ - // "parallelism": to.Ptr("1"), - // "savepoint.directory": to.Ptr("abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint"), - // }, - // JarName: to.Ptr("flink-sleep-job-0.0.1-SNAPSHOT.jar"), - // JobJarDirectory: to.Ptr("abfs://flinkjob@hilosa.dfs.core.windows.net/jars"), - // JobName: to.Ptr("flink-job-name"), - // RunID: to.Ptr("job-15a-4322-b32c-ea541845e911"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterJobs.json -func ExampleClusterJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterJobsClient().NewListPager("hiloResourcegroup", "clusterPool1", "cluster1", &armhdinsightcontainers.ClusterJobsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterJobList = armhdinsightcontainers.ClusterJobList{ - // Value: []*armhdinsightcontainers.ClusterJob{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1/jobs/flink-job-1"), - // Properties: &armhdinsightcontainers.FlinkJobProperties{ - // JobType: to.Ptr(armhdinsightcontainers.JobTypeFlinkJob), - // ActionResult: to.Ptr("SUCCESS"), - // EntryClass: to.Ptr("com.microsoft.hilo.flink.job.streaming.ExampleJob"), - // FlinkConfiguration: map[string]*string{ - // "parallelism": to.Ptr("1"), - // "savepoint.directory": to.Ptr("savepoint-directory"), - // }, - // JarName: to.Ptr("job.jar"), - // JobID: to.Ptr("362b911137dfefc2e55784666f4d4253"), - // JobJarDirectory: to.Ptr("jobJarDirectory1"), - // JobName: to.Ptr("flink-job-1"), - // JobOutput: to.Ptr("job-output"), - // RunID: to.Ptr("job-15a-4322-b32c-ea541845e911"), - // Status: to.Ptr("RUNNING"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterlibraries_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterlibraries_client.go deleted file mode 100644 index c4faf44b6f3c..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterlibraries_client.go +++ /dev/null @@ -1,202 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterLibrariesClient contains the methods for the ClusterLibraries group. -// Don't use this type directly, use NewClusterLibrariesClient() instead. -type ClusterLibrariesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterLibrariesClient creates a new instance of ClusterLibrariesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterLibrariesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterLibrariesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterLibrariesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Get all libraries of HDInsight on AKS cluster. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - category - The system query option to filter libraries returned in the response. Allowed value is 'custom' or 'predefined'. -// - options - ClusterLibrariesClientListOptions contains the optional parameters for the ClusterLibrariesClient.NewListPager -// method. -func (client *ClusterLibrariesClient) NewListPager(resourceGroupName string, clusterPoolName string, clusterName string, category Category, options *ClusterLibrariesClientListOptions) *runtime.Pager[ClusterLibrariesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterLibrariesClientListResponse]{ - More: func(page ClusterLibrariesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterLibrariesClientListResponse) (ClusterLibrariesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterLibrariesClient.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, resourceGroupName, clusterPoolName, clusterName, category, options) - }, nil) - if err != nil { - return ClusterLibrariesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ClusterLibrariesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, category Category, options *ClusterLibrariesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/libraries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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("$category", string(category)) - reqQP.Set("api-version", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ClusterLibrariesClient) listHandleResponse(resp *http.Response) (ClusterLibrariesClientListResponse, error) { - result := ClusterLibrariesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterLibraryList); err != nil { - return ClusterLibrariesClientListResponse{}, err - } - return result, nil -} - -// BeginManageLibraries - Library management operations on HDInsight on AKS cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - operation - The library management operation. -// - options - ClusterLibrariesClientBeginManageLibrariesOptions contains the optional parameters for the ClusterLibrariesClient.BeginManageLibraries -// method. -func (client *ClusterLibrariesClient) BeginManageLibraries(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, operation ClusterLibraryManagementOperation, options *ClusterLibrariesClientBeginManageLibrariesOptions) (*runtime.Poller[ClusterLibrariesClientManageLibrariesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.manageLibraries(ctx, resourceGroupName, clusterPoolName, clusterName, operation, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClusterLibrariesClientManageLibrariesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClusterLibrariesClientManageLibrariesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// ManageLibraries - Library management operations on HDInsight on AKS cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClusterLibrariesClient) manageLibraries(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, operation ClusterLibraryManagementOperation, options *ClusterLibrariesClientBeginManageLibrariesOptions) (*http.Response, error) { - var err error - const operationName = "ClusterLibrariesClient.BeginManageLibraries" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.manageLibrariesCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, operation, 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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// manageLibrariesCreateRequest creates the ManageLibraries request. -func (client *ClusterLibrariesClient) manageLibrariesCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, operation ClusterLibraryManagementOperation, options *ClusterLibrariesClientBeginManageLibrariesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/manageLibraries" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, operation); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterlibraries_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterlibraries_client_example_test.go deleted file mode 100644 index f01a6d6e0fdd..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterlibraries_client_example_test.go +++ /dev/null @@ -1,199 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListPredefinedClusterLibraries.json -func ExampleClusterLibrariesClient_NewListPager_listPredefinedClusterLibraries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterLibrariesClient().NewListPager("hiloResourceGroup", "clusterPool", "cluster", armhdinsightcontainers.CategoryPredefined, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterLibraryList = armhdinsightcontainers.ClusterLibraryList{ - // Value: []*armhdinsightcontainers.ClusterLibrary{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hiloResourceGroup/providers/Microsoft.HDInsight/clusterPools/clusterPool/clusters/cluster/libraries/pyspark"), - // Properties: &armhdinsightcontainers.PyPiLibraryProperties{ - // Type: to.Ptr(armhdinsightcontainers.TypePypi), - // Name: to.Ptr("pyspark"), - // Version: to.Ptr("3.5.0"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hiloResourceGroup/providers/Microsoft.HDInsight/clusterPools/clusterPool/clusters/cluster/libraries/spark-sql"), - // Properties: &armhdinsightcontainers.MavenLibraryProperties{ - // Type: to.Ptr(armhdinsightcontainers.TypeMaven), - // Name: to.Ptr("spark-sql"), - // GroupID: to.Ptr("org.apache.spark"), - // Version: to.Ptr("3.5.0_2.12"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListUserCustomClusterLibraries.json -func ExampleClusterLibrariesClient_NewListPager_listUserCustomClusterLibraries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterLibrariesClient().NewListPager("hiloResourceGroup", "clusterPool", "cluster", armhdinsightcontainers.CategoryCustom, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterLibraryList = armhdinsightcontainers.ClusterLibraryList{ - // Value: []*armhdinsightcontainers.ClusterLibrary{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hiloResourceGroup/providers/Microsoft.HDInsight/clusterPools/clusterPool/clusters/cluster/libraries/requests"), - // Properties: &armhdinsightcontainers.PyPiLibraryProperties{ - // Type: to.Ptr(armhdinsightcontainers.TypePypi), - // Message: to.Ptr(""), - // Remarks: to.Ptr("PyPi packages."), - // Status: to.Ptr(armhdinsightcontainers.StatusINSTALLED), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T00:00:00.000Z"); return t}()), - // Name: to.Ptr("requests"), - // Version: to.Ptr("2.31.0"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hiloResourceGroup/providers/Microsoft.HDInsight/clusterPools/clusterPool/clusters/cluster/libraries/flink-connector-kafka"), - // Properties: &armhdinsightcontainers.MavenLibraryProperties{ - // Type: to.Ptr(armhdinsightcontainers.TypeMaven), - // Message: to.Ptr(""), - // Remarks: to.Ptr("Maven packages."), - // Status: to.Ptr(armhdinsightcontainers.StatusINSTALLING), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T00:00:00.000Z"); return t}()), - // Name: to.Ptr("flink-connector-kafka"), - // GroupID: to.Ptr("org.apache.flink"), - // Version: to.Ptr("3.0.2-1.18"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/InstallNewClusterLibraries.json -func ExampleClusterLibrariesClient_BeginManageLibraries_installNewClusterLibraries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterLibrariesClient().BeginManageLibraries(ctx, "hiloResourceGroup", "clusterPool", "cluster", armhdinsightcontainers.ClusterLibraryManagementOperation{ - Properties: &armhdinsightcontainers.ClusterLibraryManagementOperationProperties{ - Action: to.Ptr(armhdinsightcontainers.LibraryManagementActionInstall), - Libraries: []*armhdinsightcontainers.ClusterLibrary{ - { - Properties: &armhdinsightcontainers.PyPiLibraryProperties{ - Type: to.Ptr(armhdinsightcontainers.TypePypi), - Remarks: to.Ptr("PyPi packages."), - Name: to.Ptr("requests"), - Version: to.Ptr("2.31.0"), - }, - }, - { - Properties: &armhdinsightcontainers.MavenLibraryProperties{ - Type: to.Ptr(armhdinsightcontainers.TypeMaven), - Remarks: to.Ptr("Maven packages."), - Name: to.Ptr("flink-connector-kafka"), - GroupID: to.Ptr("org.apache.flink"), - Version: to.Ptr("3.0.2-1.18"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/UninstallExistingClusterLibraries.json -func ExampleClusterLibrariesClient_BeginManageLibraries_uninstallExistingClusterLibraries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterLibrariesClient().BeginManageLibraries(ctx, "hiloResourceGroup", "clusterPool", "cluster", armhdinsightcontainers.ClusterLibraryManagementOperation{ - Properties: &armhdinsightcontainers.ClusterLibraryManagementOperationProperties{ - Action: to.Ptr(armhdinsightcontainers.LibraryManagementActionUninstall), - Libraries: []*armhdinsightcontainers.ClusterLibrary{ - { - Properties: &armhdinsightcontainers.PyPiLibraryProperties{ - Type: to.Ptr(armhdinsightcontainers.TypePypi), - Name: to.Ptr("tensorflow"), - }, - }, - { - Properties: &armhdinsightcontainers.MavenLibraryProperties{ - Type: to.Ptr(armhdinsightcontainers.TypeMaven), - Name: to.Ptr("flink-connector-hudi"), - GroupID: to.Ptr("org.apache.flink"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolavailableupgrades_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolavailableupgrades_client.go deleted file mode 100644 index 05513e15d354..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolavailableupgrades_client.go +++ /dev/null @@ -1,109 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterPoolAvailableUpgradesClient contains the methods for the ClusterPoolAvailableUpgrades group. -// Don't use this type directly, use NewClusterPoolAvailableUpgradesClient() instead. -type ClusterPoolAvailableUpgradesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterPoolAvailableUpgradesClient creates a new instance of ClusterPoolAvailableUpgradesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterPoolAvailableUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterPoolAvailableUpgradesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterPoolAvailableUpgradesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List a cluster pool available upgrade. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - options - ClusterPoolAvailableUpgradesClientListOptions contains the optional parameters for the ClusterPoolAvailableUpgradesClient.NewListPager -// method. -func (client *ClusterPoolAvailableUpgradesClient) NewListPager(resourceGroupName string, clusterPoolName string, options *ClusterPoolAvailableUpgradesClientListOptions) *runtime.Pager[ClusterPoolAvailableUpgradesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterPoolAvailableUpgradesClientListResponse]{ - More: func(page ClusterPoolAvailableUpgradesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterPoolAvailableUpgradesClientListResponse) (ClusterPoolAvailableUpgradesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterPoolAvailableUpgradesClient.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, resourceGroupName, clusterPoolName, options) - }, nil) - if err != nil { - return ClusterPoolAvailableUpgradesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ClusterPoolAvailableUpgradesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolAvailableUpgradesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/availableUpgrades" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ClusterPoolAvailableUpgradesClient) listHandleResponse(resp *http.Response) (ClusterPoolAvailableUpgradesClientListResponse, error) { - result := ClusterPoolAvailableUpgradesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterPoolAvailableUpgradeList); err != nil { - return ClusterPoolAvailableUpgradesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolavailableupgrades_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolavailableupgrades_client_example_test.go deleted file mode 100644 index dec4976932f5..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolavailableupgrades_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterPoolAvailableUpgrades.json -func ExampleClusterPoolAvailableUpgradesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterPoolAvailableUpgradesClient().NewListPager("hiloResourcegroup", "clusterpool1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterPoolAvailableUpgradeList = armhdinsightcontainers.ClusterPoolAvailableUpgradeList{ - // Value: []*armhdinsightcontainers.ClusterPoolAvailableUpgrade{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/availableUpgrades/AKSPatchUpgrade"), - // Properties: &armhdinsightcontainers.ClusterPoolAvailableUpgradeAksPatchUpgradeProperties{ - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade), - // CurrentVersion: to.Ptr("1.26.3"), - // CurrentVersionStatus: to.Ptr(armhdinsightcontainers.CurrentClusterPoolAksVersionStatusDeprecated), - // LatestVersion: to.Ptr("1.26.6"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/availableUpgrades/NodeOsUpgrade"), - // Properties: &armhdinsightcontainers.ClusterPoolAvailableUpgradeNodeOsUpgradeProperties{ - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterPoolAvailableUpgradeTypeNodeOsUpgrade), - // LatestVersion: to.Ptr("AKSCBLMariner-V2gen2-202310.09.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpools_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpools_client.go deleted file mode 100644 index f69deb54f81e..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpools_client.go +++ /dev/null @@ -1,542 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterPoolsClient contains the methods for the ClusterPools group. -// Don't use this type directly, use NewClusterPoolsClient() instead. -type ClusterPoolsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterPoolsClient creates a new instance of ClusterPoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterPoolsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterPoolsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates or updates a cluster pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterPool - The Cluster Pool to create. -// - options - ClusterPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClusterPoolsClient.BeginCreateOrUpdate -// method. -func (client *ClusterPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPool ClusterPool, options *ClusterPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClusterPoolsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterPoolName, clusterPool, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClusterPoolsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClusterPoolsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Creates or updates a cluster pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClusterPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPool ClusterPool, options *ClusterPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ClusterPoolsClient.BeginCreateOrUpdate" - 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, clusterPoolName, clusterPool, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ClusterPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPool ClusterPool, options *ClusterPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterPool); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a Cluster Pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - options - ClusterPoolsClientBeginDeleteOptions contains the optional parameters for the ClusterPoolsClient.BeginDelete -// method. -func (client *ClusterPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolsClientBeginDeleteOptions) (*runtime.Poller[ClusterPoolsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, clusterPoolName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClusterPoolsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClusterPoolsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a Cluster Pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClusterPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ClusterPoolsClient.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, clusterPoolName, 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 *ClusterPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a cluster pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - options - ClusterPoolsClientGetOptions contains the optional parameters for the ClusterPoolsClient.Get method. -func (client *ClusterPoolsClient) Get(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolsClientGetOptions) (ClusterPoolsClientGetResponse, error) { - var err error - const operationName = "ClusterPoolsClient.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, clusterPoolName, options) - if err != nil { - return ClusterPoolsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ClusterPoolsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ClusterPoolsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ClusterPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ClusterPoolsClient) getHandleResponse(resp *http.Response) (ClusterPoolsClientGetResponse, error) { - result := ClusterPoolsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterPool); err != nil { - return ClusterPoolsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Lists the HDInsight cluster pools under a resource group. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - ClusterPoolsClientListByResourceGroupOptions contains the optional parameters for the ClusterPoolsClient.NewListByResourceGroupPager -// method. -func (client *ClusterPoolsClient) NewListByResourceGroupPager(resourceGroupName string, options *ClusterPoolsClientListByResourceGroupOptions) *runtime.Pager[ClusterPoolsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterPoolsClientListByResourceGroupResponse]{ - More: func(page ClusterPoolsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterPoolsClientListByResourceGroupResponse) (ClusterPoolsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterPoolsClient.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 ClusterPoolsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ClusterPoolsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClusterPoolsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ClusterPoolsClient) listByResourceGroupHandleResponse(resp *http.Response) (ClusterPoolsClientListByResourceGroupResponse, error) { - result := ClusterPoolsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterPoolListResult); err != nil { - return ClusterPoolsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Gets the list of Cluster Pools within a Subscription. -// -// Generated from API version 2024-05-01-preview -// - options - ClusterPoolsClientListBySubscriptionOptions contains the optional parameters for the ClusterPoolsClient.NewListBySubscriptionPager -// method. -func (client *ClusterPoolsClient) NewListBySubscriptionPager(options *ClusterPoolsClientListBySubscriptionOptions) *runtime.Pager[ClusterPoolsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterPoolsClientListBySubscriptionResponse]{ - More: func(page ClusterPoolsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterPoolsClientListBySubscriptionResponse) (ClusterPoolsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterPoolsClient.NewListBySubscriptionPager") - 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.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return ClusterPoolsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ClusterPoolsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ClusterPoolsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusterpools" - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ClusterPoolsClient) listBySubscriptionHandleResponse(resp *http.Response) (ClusterPoolsClientListBySubscriptionResponse, error) { - result := ClusterPoolsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterPoolListResult); err != nil { - return ClusterPoolsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// BeginUpdateTags - Updates an existing Cluster Pool Tags. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterPoolTags - Parameters supplied to update tags. -// - options - ClusterPoolsClientBeginUpdateTagsOptions contains the optional parameters for the ClusterPoolsClient.BeginUpdateTags -// method. -func (client *ClusterPoolsClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolTags TagsObject, options *ClusterPoolsClientBeginUpdateTagsOptions) (*runtime.Poller[ClusterPoolsClientUpdateTagsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.updateTags(ctx, resourceGroupName, clusterPoolName, clusterPoolTags, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClusterPoolsClientUpdateTagsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClusterPoolsClientUpdateTagsResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// UpdateTags - Updates an existing Cluster Pool Tags. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClusterPoolsClient) updateTags(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolTags TagsObject, options *ClusterPoolsClientBeginUpdateTagsOptions) (*http.Response, error) { - var err error - const operationName = "ClusterPoolsClient.BeginUpdateTags" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterPoolTags, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateTagsCreateRequest creates the UpdateTags request. -func (client *ClusterPoolsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolTags TagsObject, options *ClusterPoolsClientBeginUpdateTagsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}" - 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)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterPoolTags); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpgrade - Upgrade a cluster pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterPoolUpgradeRequest - Upgrade a cluster pool. -// - options - ClusterPoolsClientBeginUpgradeOptions contains the optional parameters for the ClusterPoolsClient.BeginUpgrade -// method. -func (client *ClusterPoolsClient) BeginUpgrade(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolUpgradeRequest ClusterPoolUpgrade, options *ClusterPoolsClientBeginUpgradeOptions) (*runtime.Poller[ClusterPoolsClientUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.upgrade(ctx, resourceGroupName, clusterPoolName, clusterPoolUpgradeRequest, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClusterPoolsClientUpgradeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClusterPoolsClientUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Upgrade - Upgrade a cluster pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClusterPoolsClient) upgrade(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolUpgradeRequest ClusterPoolUpgrade, options *ClusterPoolsClientBeginUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "ClusterPoolsClient.BeginUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.upgradeCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterPoolUpgradeRequest, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// upgradeCreateRequest creates the Upgrade request. -func (client *ClusterPoolsClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolUpgradeRequest ClusterPoolUpgrade, options *ClusterPoolsClientBeginUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgrade" - 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)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterPoolUpgradeRequest); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpools_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpools_client_example_test.go deleted file mode 100644 index 7f1fe9eef78b..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpools_client_example_test.go +++ /dev/null @@ -1,672 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/GetClusterPool.json -func ExampleClusterPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterPoolsClient().Get(ctx, "hiloResourcegroup", "clusterpool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateClusterPool.json -func ExampleClusterPoolsClient_BeginCreateOrUpdate_clusterPoolPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginCreateOrUpdate(ctx, "hiloResourcegroup", "clusterpool1", armhdinsightcontainers.ClusterPool{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - ClusterPoolVersion: to.Ptr("1.2"), - }, - ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - VMSize: to.Ptr("Standard_D3_v2"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateClusterPoolWithPrivateAks.json -func ExampleClusterPoolsClient_BeginCreateOrUpdate_clusterPoolPutWithPrivateAks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginCreateOrUpdate(ctx, "hiloResourcegroup", "clusterpool1", armhdinsightcontainers.ClusterPool{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - ClusterPoolVersion: to.Ptr("1.2"), - }, - ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - VMSize: to.Ptr("Standard_D3_v2"), - }, - NetworkProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesNetworkProfile{ - EnablePrivateAPIServer: to.Ptr(true), - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // NetworkProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesNetworkProfile{ - // EnablePrivateAPIServer: to.Ptr(true), - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateClusterPoolWithUDRAks.json -func ExampleClusterPoolsClient_BeginCreateOrUpdate_clusterPoolPutWithUdrAks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginCreateOrUpdate(ctx, "hiloResourcegroup", "clusterpool1", armhdinsightcontainers.ClusterPool{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - ClusterPoolVersion: to.Ptr("1.2"), - }, - ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - VMSize: to.Ptr("Standard_D3_v2"), - }, - NetworkProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesNetworkProfile{ - OutboundType: to.Ptr(armhdinsightcontainers.OutboundTypeUserDefinedRouting), - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // NetworkProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesNetworkProfile{ - // OutboundType: to.Ptr(armhdinsightcontainers.OutboundTypeUserDefinedRouting), - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // }, - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/PatchClusterPool.json -func ExampleClusterPoolsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginUpdateTags(ctx, "hiloResourcegroup", "clusterpool1", armhdinsightcontainers.TagsObject{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/DeleteClusterPool.json -func ExampleClusterPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginDelete(ctx, "rg1", "clusterpool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterPoolsSubscription.json -func ExampleClusterPoolsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterPoolsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterPoolListResult = armhdinsightcontainers.ClusterPoolListResult{ - // Value: []*armhdinsightcontainers.ClusterPool{ - // { - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "company": to.Ptr("Contoso"), - // "department": to.Ptr("MightyMight"), - // }, - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterPools.json -func ExampleClusterPoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterPoolsClient().NewListByResourceGroupPager("hiloResourcegroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterPoolListResult = armhdinsightcontainers.ClusterPoolListResult{ - // Value: []*armhdinsightcontainers.ClusterPool{ - // { - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "company": to.Ptr("Contoso"), - // "department": to.Ptr("MightyMight"), - // }, - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/UpgradeAKSPatchVersionForClusterPool.json -func ExampleClusterPoolsClient_BeginUpgrade_clusterPoolsUpgradeAksPatchVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginUpgrade(ctx, "hiloResourcegroup", "clusterpool1", armhdinsightcontainers.ClusterPoolUpgrade{ - Properties: &armhdinsightcontainers.ClusterPoolAKSPatchVersionUpgradeProperties{ - UpgradeType: to.Ptr(armhdinsightcontainers.ClusterPoolUpgradeTypeAKSPatchUpgrade), - UpgradeAllClusterNodes: to.Ptr(false), - UpgradeClusterPool: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/UpgradeNodeOsForClusterPool.json -func ExampleClusterPoolsClient_BeginUpgrade_clusterPoolsUpgradeNodeOs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClusterPoolsClient().BeginUpgrade(ctx, "hiloResourcegroup", "clusterpool1", armhdinsightcontainers.ClusterPoolUpgrade{ - Properties: &armhdinsightcontainers.ClusterPoolNodeOsImageUpdateProperties{ - UpgradeType: to.Ptr(armhdinsightcontainers.ClusterPoolUpgradeTypeNodeOsUpgrade), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterPool = armhdinsightcontainers.ClusterPool{ - // Name: to.Ptr("clusterpool1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterPoolResourceProperties{ - // AksClusterProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesAksClusterProfile{ - // AksClusterAgentPoolIdentityProfile: &armhdinsightcontainers.AksClusterProfileAksClusterAgentPoolIdentityProfile{ - // MsiClientID: to.Ptr("a89fb478-2a84-4d9b-8f18-3e8c4d1db3eb"), - // MsiObjectID: to.Ptr("dc7ef861-8b55-4ffb-9003-20885cd895a9"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ManagedIdentity/userAssignedIdentities/clusterpool1-agentpool"), - // }, - // AksClusterResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hdi-45cd32aead6e4a91b079a0cdbfac8c36/providers/Microsoft.ContainerService/managedClusters/clusterpool1"), - // AksVersion: to.Ptr("1.24"), - // }, - // ClusterPoolProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesClusterPoolProfile{ - // ClusterPoolVersion: to.Ptr("1.2"), - // }, - // ComputeProfile: &armhdinsightcontainers.ClusterPoolResourcePropertiesComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ManagedResourceGroupName: to.Ptr("hdi-45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolupgradehistories_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolupgradehistories_client.go deleted file mode 100644 index cb8169404f0e..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolupgradehistories_client.go +++ /dev/null @@ -1,109 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterPoolUpgradeHistoriesClient contains the methods for the ClusterPoolUpgradeHistories group. -// Don't use this type directly, use NewClusterPoolUpgradeHistoriesClient() instead. -type ClusterPoolUpgradeHistoriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterPoolUpgradeHistoriesClient creates a new instance of ClusterPoolUpgradeHistoriesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterPoolUpgradeHistoriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterPoolUpgradeHistoriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterPoolUpgradeHistoriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Returns a list of upgrade history. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - options - ClusterPoolUpgradeHistoriesClientListOptions contains the optional parameters for the ClusterPoolUpgradeHistoriesClient.NewListPager -// method. -func (client *ClusterPoolUpgradeHistoriesClient) NewListPager(resourceGroupName string, clusterPoolName string, options *ClusterPoolUpgradeHistoriesClientListOptions) *runtime.Pager[ClusterPoolUpgradeHistoriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterPoolUpgradeHistoriesClientListResponse]{ - More: func(page ClusterPoolUpgradeHistoriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterPoolUpgradeHistoriesClientListResponse) (ClusterPoolUpgradeHistoriesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterPoolUpgradeHistoriesClient.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, resourceGroupName, clusterPoolName, options) - }, nil) - if err != nil { - return ClusterPoolUpgradeHistoriesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ClusterPoolUpgradeHistoriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClusterPoolUpgradeHistoriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/upgradeHistories" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ClusterPoolUpgradeHistoriesClient) listHandleResponse(resp *http.Response) (ClusterPoolUpgradeHistoriesClientListResponse, error) { - result := ClusterPoolUpgradeHistoriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterPoolUpgradeHistoryListResult); err != nil { - return ClusterPoolUpgradeHistoriesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolupgradehistories_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolupgradehistories_client_example_test.go deleted file mode 100644 index eb0a827bfa08..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterpoolupgradehistories_client_example_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterPoolUpgradeHistory.json -func ExampleClusterPoolUpgradeHistoriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterPoolUpgradeHistoriesClient().NewListPager("hiloResourcegroup", "clusterpool1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterPoolUpgradeHistoryListResult = armhdinsightcontainers.ClusterPoolUpgradeHistoryListResult{ - // Value: []*armhdinsightcontainers.ClusterPoolUpgradeHistory{ - // { - // Name: to.Ptr("nodeosupgrade1"), - // ID: to.Ptr("/subscriptions/10e32bab-26da-4cc4-a441-52b318f824e6/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterpools/clusterpool1/upgradeHistories/nodeosupgrade1"), - // Properties: &armhdinsightcontainers.ClusterPoolNodeOsUpgradeHistoryProperties{ - // UpgradeResult: to.Ptr(armhdinsightcontainers.ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed), - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterPoolUpgradeHistoryTypeNodeOsUpgrade), - // UTCTime: to.Ptr("01/18/2024 03:18:47 AM"), - // NewNodeOs: to.Ptr("1.2.2"), - // }, - // }, - // { - // Name: to.Ptr("akspatchupgrade1"), - // ID: to.Ptr("/subscriptions/10e32bab-26da-4cc4-a441-52b318f824e6/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterpools/clusterpool1/upgradeHistories/akspatchupgrade1"), - // Properties: &armhdinsightcontainers.ClusterPoolAksPatchUpgradeHistoryProperties{ - // UpgradeResult: to.Ptr(armhdinsightcontainers.ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed), - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade), - // UTCTime: to.Ptr("01/18/2024 03:18:38 AM"), - // NewVersion: to.Ptr("1.1.1"), - // UpgradeAllClusterNodes: to.Ptr(true), - // UpgradeClusterPool: to.Ptr(false), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusters_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusters_client.go deleted file mode 100644 index e43a6e937a35..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusters_client.go +++ /dev/null @@ -1,895 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClustersClient contains the methods for the Clusters group. -// Don't use this type directly, use NewClustersClient() instead. -type ClustersClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClustersClient creates a new instance of ClustersClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClustersClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreate - Creates a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - hdInsightCluster - The cluster to create. -// - options - ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method. -func (client *ClustersClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, hdInsightCluster Cluster, options *ClustersClientBeginCreateOptions) (*runtime.Poller[ClustersClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, clusterPoolName, clusterName, hdInsightCluster, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClustersClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Create - Creates a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClustersClient) create(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, hdInsightCluster Cluster, options *ClustersClientBeginCreateOptions) (*http.Response, error) { - var err error - const operationName = "ClustersClient.BeginCreate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, hdInsightCluster, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createCreateRequest creates the Create request. -func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, hdInsightCluster Cluster, options *ClustersClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, hdInsightCluster); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. -func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*runtime.Poller[ClustersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, clusterPoolName, clusterName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClustersClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ClustersClient.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, clusterPoolName, clusterName, 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 *ClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets a HDInsight cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. -func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { - var err error - const operationName = "ClustersClient.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, clusterPoolName, clusterName, options) - if err != nil { - return ClustersClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ClustersClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ClustersClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersClientGetResponse, error) { - result := ClustersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Cluster); err != nil { - return ClustersClientGetResponse{}, err - } - return result, nil -} - -// GetInstanceView - Gets the status of a cluster instance. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClustersClientGetInstanceViewOptions contains the optional parameters for the ClustersClient.GetInstanceView -// method. -func (client *ClustersClient) GetInstanceView(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientGetInstanceViewOptions) (ClustersClientGetInstanceViewResponse, error) { - var err error - const operationName = "ClustersClient.GetInstanceView" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, options) - if err != nil { - return ClustersClientGetInstanceViewResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ClustersClientGetInstanceViewResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ClustersClientGetInstanceViewResponse{}, err - } - resp, err := client.getInstanceViewHandleResponse(httpResp) - return resp, err -} - -// getInstanceViewCreateRequest creates the GetInstanceView request. -func (client *ClustersClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientGetInstanceViewOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/instanceViews/default" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getInstanceViewHandleResponse handles the GetInstanceView response. -func (client *ClustersClient) getInstanceViewHandleResponse(resp *http.Response) (ClustersClientGetInstanceViewResponse, error) { - result := ClustersClientGetInstanceViewResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterInstanceViewResult); err != nil { - return ClustersClientGetInstanceViewResponse{}, err - } - return result, nil -} - -// NewListByClusterPoolNamePager - Lists the HDInsight cluster pools under a resource group. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - options - ClustersClientListByClusterPoolNameOptions contains the optional parameters for the ClustersClient.NewListByClusterPoolNamePager -// method. -func (client *ClustersClient) NewListByClusterPoolNamePager(resourceGroupName string, clusterPoolName string, options *ClustersClientListByClusterPoolNameOptions) *runtime.Pager[ClustersClientListByClusterPoolNameResponse] { - return runtime.NewPager(runtime.PagingHandler[ClustersClientListByClusterPoolNameResponse]{ - More: func(page ClustersClientListByClusterPoolNameResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClustersClientListByClusterPoolNameResponse) (ClustersClientListByClusterPoolNameResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClustersClient.NewListByClusterPoolNamePager") - 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.listByClusterPoolNameCreateRequest(ctx, resourceGroupName, clusterPoolName, options) - }, nil) - if err != nil { - return ClustersClientListByClusterPoolNameResponse{}, err - } - return client.listByClusterPoolNameHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByClusterPoolNameCreateRequest creates the ListByClusterPoolName request. -func (client *ClustersClient) listByClusterPoolNameCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, options *ClustersClientListByClusterPoolNameOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByClusterPoolNameHandleResponse handles the ListByClusterPoolName response. -func (client *ClustersClient) listByClusterPoolNameHandleResponse(resp *http.Response) (ClustersClientListByClusterPoolNameResponse, error) { - result := ClustersClientListByClusterPoolNameResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterListResult); err != nil { - return ClustersClientListByClusterPoolNameResponse{}, err - } - return result, nil -} - -// NewListInstanceViewsPager - Lists the lists of instance views -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClustersClientListInstanceViewsOptions contains the optional parameters for the ClustersClient.NewListInstanceViewsPager -// method. -func (client *ClustersClient) NewListInstanceViewsPager(resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientListInstanceViewsOptions) *runtime.Pager[ClustersClientListInstanceViewsResponse] { - return runtime.NewPager(runtime.PagingHandler[ClustersClientListInstanceViewsResponse]{ - More: func(page ClustersClientListInstanceViewsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClustersClientListInstanceViewsResponse) (ClustersClientListInstanceViewsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClustersClient.NewListInstanceViewsPager") - 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.listInstanceViewsCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, options) - }, nil) - if err != nil { - return ClustersClientListInstanceViewsResponse{}, err - } - return client.listInstanceViewsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listInstanceViewsCreateRequest creates the ListInstanceViews request. -func (client *ClustersClient) listInstanceViewsCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientListInstanceViewsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/instanceViews" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listInstanceViewsHandleResponse handles the ListInstanceViews response. -func (client *ClustersClient) listInstanceViewsHandleResponse(resp *http.Response) (ClustersClientListInstanceViewsResponse, error) { - result := ClustersClientListInstanceViewsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterInstanceViewsResult); err != nil { - return ClustersClientListInstanceViewsResponse{}, err - } - return result, nil -} - -// NewListServiceConfigsPager - Lists the config dump of all services running in cluster. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClustersClientListServiceConfigsOptions contains the optional parameters for the ClustersClient.NewListServiceConfigsPager -// method. -func (client *ClustersClient) NewListServiceConfigsPager(resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientListServiceConfigsOptions) *runtime.Pager[ClustersClientListServiceConfigsResponse] { - return runtime.NewPager(runtime.PagingHandler[ClustersClientListServiceConfigsResponse]{ - More: func(page ClustersClientListServiceConfigsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClustersClientListServiceConfigsResponse) (ClustersClientListServiceConfigsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClustersClient.NewListServiceConfigsPager") - 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.listServiceConfigsCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, options) - }, nil) - if err != nil { - return ClustersClientListServiceConfigsResponse{}, err - } - return client.listServiceConfigsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listServiceConfigsCreateRequest creates the ListServiceConfigs request. -func (client *ClustersClient) listServiceConfigsCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClustersClientListServiceConfigsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/serviceConfigs" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listServiceConfigsHandleResponse handles the ListServiceConfigs response. -func (client *ClustersClient) listServiceConfigsHandleResponse(resp *http.Response) (ClustersClientListServiceConfigsResponse, error) { - result := ClustersClientListServiceConfigsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceConfigListResult); err != nil { - return ClustersClientListServiceConfigsResponse{}, err - } - return result, nil -} - -// BeginResize - Resize an existing Cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - clusterResizeRequest - Resize a cluster. -// - options - ClustersClientBeginResizeOptions contains the optional parameters for the ClustersClient.BeginResize method. -func (client *ClustersClient) BeginResize(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterResizeRequest ClusterResizeData, options *ClustersClientBeginResizeOptions) (*runtime.Poller[ClustersClientResizeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.resize(ctx, resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientResizeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClustersClientResizeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Resize - Resize an existing Cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClustersClient) resize(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterResizeRequest ClusterResizeData, options *ClustersClientBeginResizeOptions) (*http.Response, error) { - var err error - const operationName = "ClustersClient.BeginResize" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.resizeCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// resizeCreateRequest creates the Resize request. -func (client *ClustersClient) resizeCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterResizeRequest ClusterResizeData, options *ClustersClientBeginResizeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/resize" - 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)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterResizeRequest); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpdate - Updates an existing Cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - clusterPatchRequest - Patch a cluster. -// - options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. -func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterPatchRequest ClusterPatch, options *ClustersClientBeginUpdateOptions) (*runtime.Poller[ClustersClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClustersClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates an existing Cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterPatchRequest ClusterPatch, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ClustersClient.BeginUpdate" - 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, clusterPoolName, clusterName, clusterPatchRequest, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterPatchRequest ClusterPatch, options *ClustersClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}" - 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)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterPatchRequest); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpgrade - Upgrade a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - clusterUpgradeRequest - Upgrade a cluster. -// - options - ClustersClientBeginUpgradeOptions contains the optional parameters for the ClustersClient.BeginUpgrade method. -func (client *ClustersClient) BeginUpgrade(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterUpgradeRequest ClusterUpgrade, options *ClustersClientBeginUpgradeOptions) (*runtime.Poller[ClustersClientUpgradeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.upgrade(ctx, resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpgradeResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClustersClientUpgradeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Upgrade - Upgrade a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClustersClient) upgrade(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterUpgradeRequest ClusterUpgrade, options *ClustersClientBeginUpgradeOptions) (*http.Response, error) { - var err error - const operationName = "ClustersClient.BeginUpgrade" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.upgradeCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, clusterUpgradeRequest, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// upgradeCreateRequest creates the Upgrade request. -func (client *ClustersClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterUpgradeRequest ClusterUpgrade, options *ClustersClientBeginUpgradeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgrade" - 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)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterUpgradeRequest); err != nil { - return nil, err - } - return req, nil -} - -// BeginUpgradeManualRollback - Manual rollback upgrade for a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - clusterRollbackUpgradeRequest - Manual rollback upgrade for a cluster. -// - options - ClustersClientBeginUpgradeManualRollbackOptions contains the optional parameters for the ClustersClient.BeginUpgradeManualRollback -// method. -func (client *ClustersClient) BeginUpgradeManualRollback(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterRollbackUpgradeRequest ClusterUpgradeRollback, options *ClustersClientBeginUpgradeManualRollbackOptions) (*runtime.Poller[ClustersClientUpgradeManualRollbackResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.upgradeManualRollback(ctx, resourceGroupName, clusterPoolName, clusterName, clusterRollbackUpgradeRequest, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpgradeManualRollbackResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClustersClientUpgradeManualRollbackResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// UpgradeManualRollback - Manual rollback upgrade for a cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -func (client *ClustersClient) upgradeManualRollback(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterRollbackUpgradeRequest ClusterUpgradeRollback, options *ClustersClientBeginUpgradeManualRollbackOptions) (*http.Response, error) { - var err error - const operationName = "ClustersClient.BeginUpgradeManualRollback" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.upgradeManualRollbackCreateRequest(ctx, resourceGroupName, clusterPoolName, clusterName, clusterRollbackUpgradeRequest, 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) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// upgradeManualRollbackCreateRequest creates the UpgradeManualRollback request. -func (client *ClustersClient) upgradeManualRollbackCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterRollbackUpgradeRequest ClusterUpgradeRollback, options *ClustersClientBeginUpgradeManualRollbackOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/rollback" - 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)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, clusterRollbackUpgradeRequest); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusters_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusters_client_example_test.go deleted file mode 100644 index 79f85676521a..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusters_client_example_test.go +++ /dev/null @@ -1,2234 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClustersByClusterPoolName.json -func ExampleClustersClient_NewListByClusterPoolNamePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByClusterPoolNamePager("hiloResourcegroup", "clusterpool1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterListResult = armhdinsightcontainers.ClusterListResult{ - // Value: []*armhdinsightcontainers.Cluster{ - // { - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "company": to.Ptr("Contoso"), - // "department": to.Ptr("MightyMight"), - // }, - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // ClusterVersion: to.Ptr("1.0.6"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("Trino"), - // Version: to.Ptr("410"), - // }, - // { - // Name: to.Ptr("Hive metastore"), - // Version: to.Ptr("3.1.2"), - // }}, - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // IdentityProfile: &armhdinsightcontainers.IdentityProfile{ - // MsiClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // MsiObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }, - // OssVersion: to.Ptr("0.410.0"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("Trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("Head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }, - // { - // Type: to.Ptr("Worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/UpgradeAKSPatchVersionForCluster.json -func ExampleClustersClient_BeginUpgrade_clustersUpgradeAksPatchVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpgrade(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterUpgrade{ - Properties: &armhdinsightcontainers.ClusterAKSPatchVersionUpgradeProperties{ - UpgradeType: to.Ptr(armhdinsightcontainers.ClusterUpgradeTypeAKSPatchUpgrade), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - // AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - // Enabled: to.Ptr(true), - // GracefulDecommissionTimeout: to.Ptr[int32](3600), - // LoadBasedConfig: &armhdinsightcontainers.LoadBasedConfig{ - // CooldownPeriod: to.Ptr[int32](300), - // MaxNodes: to.Ptr[int32](20), - // MinNodes: to.Ptr[int32](10), - // PollInterval: to.Ptr[int32](60), - // ScalingRules: []*armhdinsightcontainers.ScalingRule{ - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaleup), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorGreaterThan), - // Threshold: to.Ptr[float32](90), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }, - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaledown), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorLessThan), - // Threshold: to.Ptr[float32](20), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }}, - // }, - // ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - // DefaultCount: to.Ptr[int32](10), - // Schedules: []*armhdinsightcontainers.Schedule{ - // { - // Count: to.Ptr[int32](20), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDayMonday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }, - // { - // Count: to.Ptr[int32](25), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }}, - // TimeZone: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // ClusterVersion: to.Ptr("1.0.1"), - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("2.4.1"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/UpgradeHotfixForCluster.json -func ExampleClustersClient_BeginUpgrade_clustersUpgradeHotfix() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpgrade(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterUpgrade{ - Properties: &armhdinsightcontainers.ClusterHotfixUpgradeProperties{ - UpgradeType: to.Ptr(armhdinsightcontainers.ClusterUpgradeTypeHotfixUpgrade), - ComponentName: to.Ptr("historyserver"), - TargetBuildNumber: to.Ptr("3"), - TargetClusterVersion: to.Ptr("1.0.6"), - TargetOssVersion: to.Ptr("1.16.0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - // AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - // Enabled: to.Ptr(true), - // GracefulDecommissionTimeout: to.Ptr[int32](3600), - // LoadBasedConfig: &armhdinsightcontainers.LoadBasedConfig{ - // CooldownPeriod: to.Ptr[int32](300), - // MaxNodes: to.Ptr[int32](20), - // MinNodes: to.Ptr[int32](10), - // PollInterval: to.Ptr[int32](60), - // ScalingRules: []*armhdinsightcontainers.ScalingRule{ - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaleup), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorGreaterThan), - // Threshold: to.Ptr[float32](90), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }, - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaledown), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorLessThan), - // Threshold: to.Ptr[float32](20), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }}, - // }, - // ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - // DefaultCount: to.Ptr[int32](10), - // Schedules: []*armhdinsightcontainers.Schedule{ - // { - // Count: to.Ptr[int32](20), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDayMonday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }, - // { - // Count: to.Ptr[int32](25), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }}, - // TimeZone: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // ClusterVersion: to.Ptr("1.0.1"), - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("2.4.1"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ClusterUpgradeRollback.json -func ExampleClustersClient_BeginUpgradeManualRollback() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpgradeManualRollback(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterUpgradeRollback{ - Properties: &armhdinsightcontainers.ClusterUpgradeRollbackProperties{ - UpgradeHistory: to.Ptr("/subscriptions/10e32bab-26da-4cc4-a441-52b318f824e6/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterpools/clusterpool1/clusters/cluster1/upgradeHistories/01_11_2024_02_35_03_AM-HotfixUpgrade"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - // AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - // Enabled: to.Ptr(true), - // GracefulDecommissionTimeout: to.Ptr[int32](3600), - // LoadBasedConfig: &armhdinsightcontainers.LoadBasedConfig{ - // CooldownPeriod: to.Ptr[int32](300), - // MaxNodes: to.Ptr[int32](20), - // MinNodes: to.Ptr[int32](10), - // PollInterval: to.Ptr[int32](60), - // ScalingRules: []*armhdinsightcontainers.ScalingRule{ - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaleup), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorGreaterThan), - // Threshold: to.Ptr[float32](90), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }, - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaledown), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorLessThan), - // Threshold: to.Ptr[float32](20), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }}, - // }, - // ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - // DefaultCount: to.Ptr[int32](10), - // Schedules: []*armhdinsightcontainers.Schedule{ - // { - // Count: to.Ptr[int32](20), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDayMonday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }, - // { - // Count: to.Ptr[int32](25), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }}, - // TimeZone: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // ClusterVersion: to.Ptr("1.0.1"), - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // IdentityProfile: &armhdinsightcontainers.IdentityProfile{ - // MsiClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // MsiObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // MsiResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }, - // OssVersion: to.Ptr("2.4.1"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ResizeCluster.json -func ExampleClustersClient_BeginResize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginResize(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterResizeData{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterResizeProperties{ - TargetWorkerNodeCount: to.Ptr[int32](5), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - // AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - // Enabled: to.Ptr(true), - // GracefulDecommissionTimeout: to.Ptr[int32](3600), - // LoadBasedConfig: &armhdinsightcontainers.LoadBasedConfig{ - // CooldownPeriod: to.Ptr[int32](300), - // MaxNodes: to.Ptr[int32](20), - // MinNodes: to.Ptr[int32](10), - // PollInterval: to.Ptr[int32](60), - // ScalingRules: []*armhdinsightcontainers.ScalingRule{ - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaleup), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorGreaterThan), - // Threshold: to.Ptr[float32](90), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }, - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaledown), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorLessThan), - // Threshold: to.Ptr[float32](20), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }}, - // }, - // ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - // DefaultCount: to.Ptr[int32](10), - // Schedules: []*armhdinsightcontainers.Schedule{ - // { - // Count: to.Ptr[int32](20), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDayMonday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }, - // { - // Count: to.Ptr[int32](25), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }}, - // TimeZone: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // ClusterVersion: to.Ptr("1.0.6"), - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("0.410.0"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("Trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("Head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }, - // { - // Type: to.Ptr("Worker"), - // Count: to.Ptr[int32](5), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/GetCluster.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // ClusterVersion: to.Ptr("1.0.6"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("Trino"), - // Version: to.Ptr("410"), - // }, - // { - // Name: to.Ptr("Hive metastore"), - // Version: to.Ptr("3.1.2"), - // }}, - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("0.410.0"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("Trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("Head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }, - // { - // Type: to.Ptr("Worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateAutoscaleCluster.json -func ExampleClustersClient_BeginCreate_hdInsightClusterPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.Cluster{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterResourceProperties{ - ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - UserIDs: []*string{ - to.Ptr("testuser1"), - to.Ptr("testuser2")}, - }, - AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - Enabled: to.Ptr(true), - GracefulDecommissionTimeout: to.Ptr[int32](3600), - LoadBasedConfig: &armhdinsightcontainers.LoadBasedConfig{ - CooldownPeriod: to.Ptr[int32](300), - MaxNodes: to.Ptr[int32](20), - MinNodes: to.Ptr[int32](10), - PollInterval: to.Ptr[int32](60), - ScalingRules: []*armhdinsightcontainers.ScalingRule{ - { - ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaleup), - ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorGreaterThan), - Threshold: to.Ptr[float32](90), - }, - EvaluationCount: to.Ptr[int32](3), - ScalingMetric: to.Ptr("cpu"), - }, - { - ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaledown), - ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorLessThan), - Threshold: to.Ptr[float32](20), - }, - EvaluationCount: to.Ptr[int32](3), - ScalingMetric: to.Ptr("cpu"), - }}, - }, - ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - DefaultCount: to.Ptr[int32](10), - Schedules: []*armhdinsightcontainers.Schedule{ - { - Count: to.Ptr[int32](20), - Days: []*armhdinsightcontainers.ScheduleDay{ - to.Ptr(armhdinsightcontainers.ScheduleDayMonday)}, - EndTime: to.Ptr("12:00"), - StartTime: to.Ptr("00:00"), - }, - { - Count: to.Ptr[int32](25), - Days: []*armhdinsightcontainers.ScheduleDay{ - to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - EndTime: to.Ptr("12:00"), - StartTime: to.Ptr("00:00"), - }}, - TimeZone: to.Ptr("Cen. Australia Standard Time"), - }, - }, - ClusterVersion: to.Ptr("1.0.6"), - ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - { - Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - }}, - }, - OssVersion: to.Ptr("0.410.0"), - SSHProfile: &armhdinsightcontainers.SSHProfile{ - Count: to.Ptr[int32](2), - VMSize: to.Ptr("Standard_E8as_v5"), - }, - TrinoProfile: &armhdinsightcontainers.TrinoProfile{}, - }, - ClusterType: to.Ptr("Trino"), - ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - Nodes: []*armhdinsightcontainers.NodeProfile{ - { - Type: to.Ptr("Head"), - Count: to.Ptr[int32](2), - VMSize: to.Ptr("Standard_E8as_v5"), - }, - { - Type: to.Ptr("Worker"), - Count: to.Ptr[int32](3), - VMSize: to.Ptr("Standard_E8as_v5"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - // AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - // Enabled: to.Ptr(true), - // GracefulDecommissionTimeout: to.Ptr[int32](3600), - // LoadBasedConfig: &armhdinsightcontainers.LoadBasedConfig{ - // CooldownPeriod: to.Ptr[int32](300), - // MaxNodes: to.Ptr[int32](20), - // MinNodes: to.Ptr[int32](10), - // PollInterval: to.Ptr[int32](60), - // ScalingRules: []*armhdinsightcontainers.ScalingRule{ - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaleup), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorGreaterThan), - // Threshold: to.Ptr[float32](90), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }, - // { - // ActionType: to.Ptr(armhdinsightcontainers.ScaleActionTypeScaledown), - // ComparisonRule: &armhdinsightcontainers.ComparisonRule{ - // Operator: to.Ptr(armhdinsightcontainers.ComparisonOperatorLessThan), - // Threshold: to.Ptr[float32](20), - // }, - // EvaluationCount: to.Ptr[int32](3), - // ScalingMetric: to.Ptr("cpu"), - // }}, - // }, - // ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - // DefaultCount: to.Ptr[int32](10), - // Schedules: []*armhdinsightcontainers.Schedule{ - // { - // Count: to.Ptr[int32](20), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDayMonday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }, - // { - // Count: to.Ptr[int32](25), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }}, - // TimeZone: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // ClusterVersion: to.Ptr("1.0.6"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("Trino"), - // Version: to.Ptr("410"), - // }, - // { - // Name: to.Ptr("Hive metastore"), - // Version: to.Ptr("3.1.2"), - // }}, - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("0.410.0"), - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("Trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("Head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }, - // { - // Type: to.Ptr("Worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateRangerCluster.json -func ExampleClustersClient_BeginCreate_hdInsightRangerClusterPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.Cluster{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterResourceProperties{ - ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - UserIDs: []*string{ - to.Ptr("testuser1"), - to.Ptr("testuser2")}, - }, - ClusterVersion: to.Ptr("0.0.1"), - ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - { - Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - }}, - }, - OssVersion: to.Ptr("2.2.3"), - RangerProfile: &armhdinsightcontainers.RangerProfile{ - RangerAdmin: &armhdinsightcontainers.RangerAdminSpec{ - Admins: []*string{ - to.Ptr("testuser1@contoso.com"), - to.Ptr("testuser2@contoso.com")}, - Database: &armhdinsightcontainers.RangerAdminSpecDatabase{ - Name: to.Ptr("testdb"), - Host: to.Ptr("testsqlserver.database.windows.net"), - PasswordSecretRef: to.Ptr("https://testkv.vault.azure.net/secrets/mysecret/5df6584d9c25418c8d900240aa6c3452"), - Username: to.Ptr("admin"), - }, - }, - RangerAudit: &armhdinsightcontainers.RangerAuditSpec{ - StorageAccount: to.Ptr("https://teststorage.blob.core.windows.net/testblob"), - }, - RangerUsersync: &armhdinsightcontainers.RangerUsersyncSpec{ - Enabled: to.Ptr(true), - Groups: []*string{ - to.Ptr("0a53828f-36c9-44c3-be3d-99a7fce977ad"), - to.Ptr("13be6971-79db-4f33-9d41-b25589ca25ac")}, - Mode: to.Ptr(armhdinsightcontainers.RangerUsersyncModeAutomatic), - Users: []*string{ - to.Ptr("testuser1@contoso.com"), - to.Ptr("testuser2@contoso.com")}, - }, - }, - }, - ClusterType: to.Ptr("ranger"), - ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - Nodes: []*armhdinsightcontainers.NodeProfile{ - { - Type: to.Ptr("head"), - Count: to.Ptr[int32](2), - VMSize: to.Ptr("Standard_D3_v2"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // ClusterVersion: to.Ptr("0.0.1"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("HDFS"), - // Version: to.Ptr("2.2.3"), - // }}, - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("2.2.3"), - // RangerProfile: &armhdinsightcontainers.RangerProfile{ - // RangerAdmin: &armhdinsightcontainers.RangerAdminSpec{ - // Admins: []*string{ - // to.Ptr("testuser1@contoso.com"), - // to.Ptr("testuser2@contoso.com")}, - // Database: &armhdinsightcontainers.RangerAdminSpecDatabase{ - // Name: to.Ptr("testdb"), - // Host: to.Ptr("testsqlserver.database.windows.net"), - // PasswordSecretRef: to.Ptr("https://testkv.vault.azure.net/secrets/mysecret/5df6584d9c25418c8d900240aa6c3452"), - // Username: to.Ptr("admin"), - // }, - // }, - // RangerAudit: &armhdinsightcontainers.RangerAuditSpec{ - // StorageAccount: to.Ptr("https://teststorage.blob.core.windows.net/testblob"), - // }, - // RangerUsersync: &armhdinsightcontainers.RangerUsersyncSpec{ - // Enabled: to.Ptr(true), - // Groups: []*string{ - // to.Ptr("0a53828f-36c9-44c3-be3d-99a7fce977ad"), - // to.Ptr("13be6971-79db-4f33-9d41-b25589ca25ac")}, - // Mode: to.Ptr(armhdinsightcontainers.RangerUsersyncModeAutomatic), - // Users: []*string{ - // to.Ptr("testuser1@contoso.com"), - // to.Ptr("testuser2@contoso.com")}, - // }, - // }, - // }, - // ClusterType: to.Ptr("ranger"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateSparkCluster.json -func ExampleClustersClient_BeginCreate_hdInsightSparkClusterPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.Cluster{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterResourceProperties{ - ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - UserIDs: []*string{ - to.Ptr("testuser1"), - to.Ptr("testuser2")}, - }, - ClusterVersion: to.Ptr("0.0.1"), - ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - { - Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - }}, - }, - OssVersion: to.Ptr("2.2.3"), - ServiceConfigsProfiles: []*armhdinsightcontainers.ClusterServiceConfigsProfile{ - { - Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - { - Component: to.Ptr("spark-config"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - FileName: to.Ptr("spark-defaults.conf"), - Values: map[string]*string{ - "spark.eventLog.enabled": to.Ptr("true"), - }, - }}, - }}, - ServiceName: to.Ptr("spark-service"), - }, - { - Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - { - Component: to.Ptr("yarn-config"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - FileName: to.Ptr("core-site.xml"), - Values: map[string]*string{ - "fs.defaultFS": to.Ptr("wasb://testcontainer@teststorage.dfs.core.windows.net/"), - "storage.container": to.Ptr("testcontainer"), - "storage.key": to.Ptr("test key"), - "storage.name": to.Ptr("teststorage"), - "storage.protocol": to.Ptr("wasb"), - }, - }, - { - FileName: to.Ptr("yarn-site.xml"), - Values: map[string]*string{ - "yarn.webapp.ui2.enable": to.Ptr("false"), - }, - }}, - }}, - ServiceName: to.Ptr("yarn-service"), - }}, - SparkProfile: &armhdinsightcontainers.SparkProfile{}, - SSHProfile: &armhdinsightcontainers.SSHProfile{ - Count: to.Ptr[int32](2), - VMSize: to.Ptr("Standard_D3_v2"), - }, - }, - ClusterType: to.Ptr("spark"), - ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - Nodes: []*armhdinsightcontainers.NodeProfile{ - { - Type: to.Ptr("worker"), - Count: to.Ptr[int32](4), - VMSize: to.Ptr("Standard_D3_v2"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // ClusterVersion: to.Ptr("0.0.1"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("HDFS"), - // Version: to.Ptr("2.2.3"), - // }}, - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("2.2.3"), - // ServiceConfigsProfiles: []*armhdinsightcontainers.ClusterServiceConfigsProfile{ - // { - // Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - // { - // Component: to.Ptr("spark-config"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // FileName: to.Ptr("spark-defaults.conf"), - // Values: map[string]*string{ - // "spark.eventLog.enabled": to.Ptr("true"), - // }, - // }}, - // }}, - // ServiceName: to.Ptr("spark-service"), - // }, - // { - // Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - // { - // Component: to.Ptr("yarn-config"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // FileName: to.Ptr("core-site.xml"), - // Values: map[string]*string{ - // "fs.defaultFS": to.Ptr("wasb://testcontainer@teststorage.dfs.core.windows.net/"), - // "storage.container": to.Ptr("testcontainer"), - // "storage.key": to.Ptr("test key"), - // "storage.name": to.Ptr("teststorage"), - // "storage.protocol": to.Ptr("wasb"), - // }, - // }, - // { - // FileName: to.Ptr("yarn-site.xml"), - // Values: map[string]*string{ - // "yarn.webapp.ui2.enable": to.Ptr("false"), - // }, - // }}, - // }}, - // ServiceName: to.Ptr("yarn-service"), - // }}, - // SparkProfile: &armhdinsightcontainers.SparkProfile{ - // }, - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // }, - // }, - // ClusterType: to.Ptr("spark"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("worker"), - // Count: to.Ptr[int32](4), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/CreateSparkClusterWithInternalIngress.json -func ExampleClustersClient_BeginCreate_hdInsightSparkClusterPutWithInternalIngress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.Cluster{ - Location: to.Ptr("West US 2"), - Properties: &armhdinsightcontainers.ClusterResourceProperties{ - ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - UserIDs: []*string{ - to.Ptr("testuser1"), - to.Ptr("testuser2")}, - }, - ClusterAccessProfile: &armhdinsightcontainers.ClusterAccessProfile{ - EnableInternalIngress: to.Ptr(true), - }, - ClusterVersion: to.Ptr("0.0.1"), - ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - { - Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - }}, - }, - OssVersion: to.Ptr("2.2.3"), - ServiceConfigsProfiles: []*armhdinsightcontainers.ClusterServiceConfigsProfile{ - { - Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - { - Component: to.Ptr("spark-config"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - FileName: to.Ptr("spark-defaults.conf"), - Values: map[string]*string{ - "spark.eventLog.enabled": to.Ptr("true"), - }, - }}, - }}, - ServiceName: to.Ptr("spark-service"), - }, - { - Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - { - Component: to.Ptr("yarn-config"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - FileName: to.Ptr("core-site.xml"), - Values: map[string]*string{ - "fs.defaultFS": to.Ptr("wasb://testcontainer@teststorage.dfs.core.windows.net/"), - "storage.container": to.Ptr("testcontainer"), - "storage.key": to.Ptr("test key"), - "storage.name": to.Ptr("teststorage"), - "storage.protocol": to.Ptr("wasb"), - }, - }, - { - FileName: to.Ptr("yarn-site.xml"), - Values: map[string]*string{ - "yarn.webapp.ui2.enable": to.Ptr("false"), - }, - }}, - }}, - ServiceName: to.Ptr("yarn-service"), - }}, - SparkProfile: &armhdinsightcontainers.SparkProfile{}, - SSHProfile: &armhdinsightcontainers.SSHProfile{ - Count: to.Ptr[int32](2), - VMSize: to.Ptr("Standard_D3_v2"), - }, - }, - ClusterType: to.Ptr("spark"), - ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - AvailabilityZones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - Nodes: []*armhdinsightcontainers.NodeProfile{ - { - Type: to.Ptr("worker"), - Count: to.Ptr[int32](4), - VMSize: to.Ptr("Standard_D3_v2"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // ClusterAccessProfile: &armhdinsightcontainers.ClusterAccessProfile{ - // EnableInternalIngress: to.Ptr(true), - // PrivateLinkServiceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.Network/privateLinkServices/testpls"), - // }, - // ClusterVersion: to.Ptr("0.0.1"), - // Components: []*armhdinsightcontainers.ClusterComponentsItem{ - // { - // Name: to.Ptr("HDFS"), - // Version: to.Ptr("2.2.3"), - // }}, - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // PrivateSSHEndpoint: to.Ptr("cluster1-int.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // PrivateSSHEndpoint: to.Ptr("cluster1-int.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // PrivateFqdn: to.Ptr("cluster1-int.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("2.2.3"), - // ServiceConfigsProfiles: []*armhdinsightcontainers.ClusterServiceConfigsProfile{ - // { - // Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - // { - // Component: to.Ptr("spark-config"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // FileName: to.Ptr("spark-defaults.conf"), - // Values: map[string]*string{ - // "spark.eventLog.enabled": to.Ptr("true"), - // }, - // }}, - // }}, - // ServiceName: to.Ptr("spark-service"), - // }, - // { - // Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - // { - // Component: to.Ptr("yarn-config"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // FileName: to.Ptr("core-site.xml"), - // Values: map[string]*string{ - // "fs.defaultFS": to.Ptr("wasb://testcontainer@teststorage.dfs.core.windows.net/"), - // "storage.container": to.Ptr("testcontainer"), - // "storage.key": to.Ptr("test key"), - // "storage.name": to.Ptr("teststorage"), - // "storage.protocol": to.Ptr("wasb"), - // }, - // }, - // { - // FileName: to.Ptr("yarn-site.xml"), - // Values: map[string]*string{ - // "yarn.webapp.ui2.enable": to.Ptr("false"), - // }, - // }}, - // }}, - // ServiceName: to.Ptr("yarn-service"), - // }}, - // SparkProfile: &armhdinsightcontainers.SparkProfile{ - // }, - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // }, - // ClusterType: to.Ptr("spark"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("worker"), - // Count: to.Ptr[int32](4), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/PatchCluster.json -func ExampleClustersClient_BeginUpdate_hdInsightClustersPatchTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterPatch{ - Properties: &armhdinsightcontainers.ClusterPatchProperties{ - ClusterProfile: &armhdinsightcontainers.UpdatableClusterProfile{ - AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - UserIDs: []*string{ - to.Ptr("Testuser1"), - to.Ptr("Testuser2")}, - }, - AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - Enabled: to.Ptr(true), - GracefulDecommissionTimeout: to.Ptr[int32](-1), - ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - DefaultCount: to.Ptr[int32](3), - Schedules: []*armhdinsightcontainers.Schedule{ - { - Count: to.Ptr[int32](3), - Days: []*armhdinsightcontainers.ScheduleDay{ - to.Ptr(armhdinsightcontainers.ScheduleDay("Monday, Tuesday, Wednesday"))}, - EndTime: to.Ptr("12:00"), - StartTime: to.Ptr("00:00"), - }, - { - Count: to.Ptr[int32](3), - Days: []*armhdinsightcontainers.ScheduleDay{ - to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - EndTime: to.Ptr("12:00"), - StartTime: to.Ptr("00:00"), - }}, - TimeZone: to.Ptr("Cen. Australia Standard Time"), - }, - }, - LogAnalyticsProfile: &armhdinsightcontainers.ClusterLogAnalyticsProfile{ - ApplicationLogs: &armhdinsightcontainers.ClusterLogAnalyticsApplicationLogs{ - StdErrorEnabled: to.Ptr(true), - StdOutEnabled: to.Ptr(true), - }, - Enabled: to.Ptr(true), - MetricsEnabled: to.Ptr(true), - }, - ServiceConfigsProfiles: []*armhdinsightcontainers.ClusterServiceConfigsProfile{ - { - Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - { - Component: to.Ptr("TestComp1"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - FileName: to.Ptr("TestFile1"), - Values: map[string]*string{ - "Test.config.1": to.Ptr("1"), - "Test.config.2": to.Ptr("2"), - }, - }, - { - FileName: to.Ptr("TestFile2"), - Values: map[string]*string{ - "Test.config.3": to.Ptr("3"), - "Test.config.4": to.Ptr("4"), - }, - }}, - }, - { - Component: to.Ptr("TestComp2"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - Path: to.Ptr("TestPath"), - Content: to.Ptr("TestContent"), - FileName: to.Ptr("TestFile3"), - }, - { - FileName: to.Ptr("TestFile4"), - Values: map[string]*string{ - "Test.config.7": to.Ptr("7"), - "Test.config.8": to.Ptr("8"), - }, - }}, - }}, - ServiceName: to.Ptr("TestService1"), - }, - { - Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - { - Component: to.Ptr("TestComp3"), - Files: []*armhdinsightcontainers.ClusterConfigFile{ - { - FileName: to.Ptr("TestFile5"), - Values: map[string]*string{ - "Test.config.9": to.Ptr("9"), - }, - }}, - }}, - ServiceName: to.Ptr("TestService2"), - }}, - SSHProfile: &armhdinsightcontainers.SSHProfile{ - Count: to.Ptr[int32](2), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // AutoscaleProfile: &armhdinsightcontainers.AutoscaleProfile{ - // AutoscaleType: to.Ptr(armhdinsightcontainers.AutoscaleTypeScheduleBased), - // Enabled: to.Ptr(true), - // GracefulDecommissionTimeout: to.Ptr[int32](-1), - // ScheduleBasedConfig: &armhdinsightcontainers.ScheduleBasedConfig{ - // DefaultCount: to.Ptr[int32](3), - // Schedules: []*armhdinsightcontainers.Schedule{ - // { - // Count: to.Ptr[int32](3), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDay("Monday, Tuesday, Wednesday"))}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }, - // { - // Count: to.Ptr[int32](3), - // Days: []*armhdinsightcontainers.ScheduleDay{ - // to.Ptr(armhdinsightcontainers.ScheduleDaySunday)}, - // EndTime: to.Ptr("12:00"), - // StartTime: to.Ptr("00:00"), - // }}, - // TimeZone: to.Ptr("Cen. Australia Standard Time"), - // }, - // }, - // ClusterVersion: to.Ptr("1.0.6"), - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // SSH: []*armhdinsightcontainers.SSHConnectivityEndpoint{ - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-0"), - // }, - // { - // Endpoint: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net/ssh/host/sshnode-1"), - // }}, - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // LogAnalyticsProfile: &armhdinsightcontainers.ClusterLogAnalyticsProfile{ - // ApplicationLogs: &armhdinsightcontainers.ClusterLogAnalyticsApplicationLogs{ - // StdErrorEnabled: to.Ptr(true), - // StdOutEnabled: to.Ptr(true), - // }, - // Enabled: to.Ptr(true), - // MetricsEnabled: to.Ptr(true), - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("0.410.0"), - // ServiceConfigsProfiles: []*armhdinsightcontainers.ClusterServiceConfigsProfile{ - // { - // Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - // { - // Component: to.Ptr("TestComp1"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // FileName: to.Ptr("TestFile1"), - // Values: map[string]*string{ - // "Test.config.1": to.Ptr("1"), - // "Test.config.2": to.Ptr("2"), - // }, - // }, - // { - // FileName: to.Ptr("TestFile2"), - // Values: map[string]*string{ - // "Test.config.3": to.Ptr("3"), - // "Test.config.4": to.Ptr("4"), - // }, - // }}, - // }, - // { - // Component: to.Ptr("TestComp2"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // Path: to.Ptr("TestPath"), - // Content: to.Ptr("TestContent"), - // FileName: to.Ptr("TestFile3"), - // }, - // { - // FileName: to.Ptr("TestFile4"), - // Values: map[string]*string{ - // "Test.config.7": to.Ptr("7"), - // "Test.config.8": to.Ptr("8"), - // }, - // }}, - // }}, - // ServiceName: to.Ptr("TestService1"), - // }, - // { - // Configs: []*armhdinsightcontainers.ClusterServiceConfig{ - // { - // Component: to.Ptr("TestComp3"), - // Files: []*armhdinsightcontainers.ClusterConfigFile{ - // { - // FileName: to.Ptr("TestFile5"), - // Values: map[string]*string{ - // "Test.config.9": to.Ptr("9"), - // }, - // }}, - // }}, - // ServiceName: to.Ptr("TestService2"), - // }}, - // SSHProfile: &armhdinsightcontainers.SSHProfile{ - // Count: to.Ptr[int32](2), - // PodPrefix: to.Ptr("sshnode"), - // VMSize: to.Ptr("Standard_D3_v2"), - // }, - // TrinoProfile: &armhdinsightcontainers.TrinoProfile{ - // }, - // }, - // ClusterType: to.Ptr("Trino"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("Head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }, - // { - // Type: to.Ptr("Worker"), - // Count: to.Ptr[int32](3), - // VMSize: to.Ptr("Standard_E8as_v5"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/PatchRangerCluster.json -func ExampleClustersClient_BeginUpdate_hdInsightRangerClusterPatchTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "hiloResourcegroup", "clusterpool1", "cluster1", armhdinsightcontainers.ClusterPatch{ - Properties: &armhdinsightcontainers.ClusterPatchProperties{ - ClusterProfile: &armhdinsightcontainers.UpdatableClusterProfile{ - RangerProfile: &armhdinsightcontainers.RangerProfile{ - RangerAdmin: &armhdinsightcontainers.RangerAdminSpec{ - Admins: []*string{ - to.Ptr("testuser1@contoso.com"), - to.Ptr("testuser2@contoso.com")}, - Database: &armhdinsightcontainers.RangerAdminSpecDatabase{ - Name: to.Ptr("testdb"), - Host: to.Ptr("testsqlserver.database.windows.net"), - PasswordSecretRef: to.Ptr("https://testkv.vault.azure.net/secrets/mysecret/5df6584d9c25418c8d900240aa6c3452"), - Username: to.Ptr("admin"), - }, - }, - RangerAudit: &armhdinsightcontainers.RangerAuditSpec{ - StorageAccount: to.Ptr("https://teststorage.blob.core.windows.net/testblob"), - }, - RangerUsersync: &armhdinsightcontainers.RangerUsersyncSpec{ - Enabled: to.Ptr(true), - Groups: []*string{ - to.Ptr("0a53828f-36c9-44c3-be3d-99a7fce977ad"), - to.Ptr("13be6971-79db-4f33-9d41-b25589ca25ac")}, - Mode: to.Ptr(armhdinsightcontainers.RangerUsersyncModeAutomatic), - Users: []*string{ - to.Ptr("testuser1@contoso.com"), - to.Ptr("testuser2@contoso.com")}, - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsightcontainers.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1"), - // SystemData: &armhdinsightcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armhdinsightcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhdinsightcontainers.ClusterResourceProperties{ - // ClusterProfile: &armhdinsightcontainers.ClusterProfile{ - // AuthorizationProfile: &armhdinsightcontainers.AuthorizationProfile{ - // UserIDs: []*string{ - // to.Ptr("testuser1"), - // to.Ptr("testuser2")}, - // }, - // ClusterVersion: to.Ptr("1.0.1"), - // ConnectivityProfile: &armhdinsightcontainers.ConnectivityProfile{ - // Web: &armhdinsightcontainers.ConnectivityProfileWeb{ - // Fqdn: to.Ptr("cluster1.clusterpool1.westus2.projecthilo.net"), - // }, - // }, - // LogAnalyticsProfile: &armhdinsightcontainers.ClusterLogAnalyticsProfile{ - // ApplicationLogs: &armhdinsightcontainers.ClusterLogAnalyticsApplicationLogs{ - // StdErrorEnabled: to.Ptr(true), - // StdOutEnabled: to.Ptr(true), - // }, - // Enabled: to.Ptr(true), - // MetricsEnabled: to.Ptr(true), - // }, - // ManagedIdentityProfile: &armhdinsightcontainers.ManagedIdentityProfile{ - // IdentityList: []*armhdinsightcontainers.ManagedIdentitySpec{ - // { - // Type: to.Ptr(armhdinsightcontainers.ManagedIdentityTypeCluster), - // ClientID: to.Ptr("de91f1d8-767f-460a-ac11-3cf103f74b34"), - // ObjectID: to.Ptr("40491351-c240-4042-91e0-f644a1d2b441"), - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi"), - // }}, - // }, - // OssVersion: to.Ptr("2.4.1"), - // RangerProfile: &armhdinsightcontainers.RangerProfile{ - // RangerAdmin: &armhdinsightcontainers.RangerAdminSpec{ - // Admins: []*string{ - // to.Ptr("testuser1@contoso.com"), - // to.Ptr("testuser2@contoso.com")}, - // Database: &armhdinsightcontainers.RangerAdminSpecDatabase{ - // Name: to.Ptr("testdb"), - // Host: to.Ptr("testsqlserver.database.windows.net"), - // PasswordSecretRef: to.Ptr("https://testkv.vault.azure.net/secrets/mysecret/5df6584d9c25418c8d900240aa6c3452"), - // Username: to.Ptr("admin"), - // }, - // }, - // RangerAudit: &armhdinsightcontainers.RangerAuditSpec{ - // StorageAccount: to.Ptr("https://teststorage.blob.core.windows.net/testblob"), - // }, - // RangerUsersync: &armhdinsightcontainers.RangerUsersyncSpec{ - // Enabled: to.Ptr(true), - // Groups: []*string{ - // to.Ptr("0a53828f-36c9-44c3-be3d-99a7fce977ad"), - // to.Ptr("13be6971-79db-4f33-9d41-b25589ca25ac")}, - // Mode: to.Ptr(armhdinsightcontainers.RangerUsersyncModeAutomatic), - // Users: []*string{ - // to.Ptr("testuser1@contoso.com"), - // to.Ptr("testuser2@contoso.com")}, - // }, - // }, - // }, - // ClusterType: to.Ptr("ranger"), - // ComputeProfile: &armhdinsightcontainers.ComputeProfile{ - // AvailabilityZones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // Nodes: []*armhdinsightcontainers.NodeProfile{ - // { - // Type: to.Ptr("head"), - // Count: to.Ptr[int32](2), - // VMSize: to.Ptr("Standard_D3_v2"), - // }}, - // }, - // DeploymentID: to.Ptr("45cd32aead6e4a91b079a0cdbfac8c36"), - // ProvisioningState: to.Ptr(armhdinsightcontainers.ProvisioningStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/DeleteCluster.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "rg1", "clusterpool1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterServiceConfigs.json -func ExampleClustersClient_NewListServiceConfigsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListServiceConfigsPager("rg1", "clusterPool1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceConfigListResult = armhdinsightcontainers.ServiceConfigListResult{ - // Value: []*armhdinsightcontainers.ServiceConfigResult{ - // { - // Properties: &armhdinsightcontainers.ServiceConfigResultProperties{ - // ComponentName: to.Ptr("hadoop-component"), - // Content: to.Ptr(""), - // FileName: to.Ptr("capacity-scheduler.xml"), - // ServiceName: to.Ptr("hadoop-service"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterInstanceViews.json -func ExampleClustersClient_NewListInstanceViewsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListInstanceViewsPager("rg1", "clusterPool1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterInstanceViewsResult = armhdinsightcontainers.ClusterInstanceViewsResult{ - // Value: []*armhdinsightcontainers.ClusterInstanceViewResult{ - // { - // Name: to.Ptr("default"), - // Properties: &armhdinsightcontainers.ClusterInstanceViewResultProperties{ - // ServiceStatuses: []*armhdinsightcontainers.ServiceStatus{ - // { - // Kind: to.Ptr("ZooKeeper"), - // Message: to.Ptr(""), - // Ready: to.Ptr("true"), - // }}, - // Status: &armhdinsightcontainers.ClusterInstanceViewPropertiesStatus{ - // Message: to.Ptr(""), - // Ready: to.Ptr("True"), - // Reason: to.Ptr(""), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/GetClusterInstanceView.json -func ExampleClustersClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().GetInstanceView(ctx, "rg1", "clusterPool1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterInstanceViewResult = armhdinsightcontainers.ClusterInstanceViewResult{ - // Name: to.Ptr("default"), - // Properties: &armhdinsightcontainers.ClusterInstanceViewResultProperties{ - // ServiceStatuses: []*armhdinsightcontainers.ServiceStatus{ - // { - // Kind: to.Ptr("ZooKeeper"), - // Message: to.Ptr(""), - // Ready: to.Ptr("true"), - // }}, - // Status: &armhdinsightcontainers.ClusterInstanceViewPropertiesStatus{ - // Message: to.Ptr(""), - // Ready: to.Ptr("True"), - // Reason: to.Ptr(""), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterupgradehistories_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterupgradehistories_client.go deleted file mode 100644 index 6b923fe4e732..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterupgradehistories_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// ClusterUpgradeHistoriesClient contains the methods for the ClusterUpgradeHistories group. -// Don't use this type directly, use NewClusterUpgradeHistoriesClient() instead. -type ClusterUpgradeHistoriesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewClusterUpgradeHistoriesClient creates a new instance of ClusterUpgradeHistoriesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClusterUpgradeHistoriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterUpgradeHistoriesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ClusterUpgradeHistoriesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Returns a list of upgrade history. -// -// Generated from API version 2024-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - clusterPoolName - The name of the cluster pool. -// - clusterName - The name of the HDInsight cluster. -// - options - ClusterUpgradeHistoriesClientListOptions contains the optional parameters for the ClusterUpgradeHistoriesClient.NewListPager -// method. -func (client *ClusterUpgradeHistoriesClient) NewListPager(resourceGroupName string, clusterPoolName string, clusterName string, options *ClusterUpgradeHistoriesClientListOptions) *runtime.Pager[ClusterUpgradeHistoriesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ClusterUpgradeHistoriesClientListResponse]{ - More: func(page ClusterUpgradeHistoriesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ClusterUpgradeHistoriesClientListResponse) (ClusterUpgradeHistoriesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ClusterUpgradeHistoriesClient.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, resourceGroupName, clusterPoolName, clusterName, options) - }, nil) - if err != nil { - return ClusterUpgradeHistoriesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ClusterUpgradeHistoriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *ClusterUpgradeHistoriesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/upgradeHistories" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if clusterPoolName == "" { - return nil, errors.New("parameter clusterPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterPoolName}", url.PathEscape(clusterPoolName)) - if clusterName == "" { - return nil, errors.New("parameter clusterName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ClusterUpgradeHistoriesClient) listHandleResponse(resp *http.Response) (ClusterUpgradeHistoriesClientListResponse, error) { - result := ClusterUpgradeHistoriesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ClusterUpgradeHistoryListResult); err != nil { - return ClusterUpgradeHistoriesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterupgradehistories_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterupgradehistories_client_example_test.go deleted file mode 100644 index 184a3c36cee5..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/clusterupgradehistories_client_example_test.go +++ /dev/null @@ -1,63 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/ListClusterUpgradeHistory.json -func ExampleClusterUpgradeHistoriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClusterUpgradeHistoriesClient().NewListPager("hiloResourcegroup", "clusterpool1", "cluster1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterUpgradeHistoryListResult = armhdinsightcontainers.ClusterUpgradeHistoryListResult{ - // Value: []*armhdinsightcontainers.ClusterUpgradeHistory{ - // { - // Name: to.Ptr("upgradeDefinitionCR1"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.HDInsight/clusterPools/clusterpool1/clusters/cluster1/upgradeHistories/upgradeDefinitionCR1"), - // Properties: &armhdinsightcontainers.ClusterHotfixUpgradeHistoryProperties{ - // UpgradeResult: to.Ptr(armhdinsightcontainers.ClusterUpgradeHistoryUpgradeResultTypeSucceed), - // UpgradeType: to.Ptr(armhdinsightcontainers.ClusterUpgradeHistoryTypeHotfixUpgrade), - // UTCTime: to.Ptr("01/18/2024 03:18:38 AM"), - // ComponentName: to.Ptr("Zookeeper"), - // Severity: to.Ptr(armhdinsightcontainers.ClusterUpgradeHistorySeverityTypeLow), - // SourceBuildNumber: to.Ptr("1"), - // SourceClusterVersion: to.Ptr("1.0.1"), - // SourceOssVersion: to.Ptr("2.4.1"), - // TargetBuildNumber: to.Ptr("2"), - // TargetClusterVersion: to.Ptr("1.0.1"), - // TargetOssVersion: to.Ptr("2.4.1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/constants.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/constants.go deleted file mode 100644 index 1b8529dd9417..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/constants.go +++ /dev/null @@ -1,682 +0,0 @@ -//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 armhdinsightcontainers - -const ( - moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - moduleVersion = "v0.4.0" -) - -// Action - A string property that indicates the action to be performed on the Flink job. It can have one of the following -// enum values => NEW, UPDATE, STATELESSUPDATE, STOP, START, CANCEL, SAVEPOINT, LIST -// SAVEPOINT, or DELETE. -type Action string - -const ( - ActionCANCEL Action = "CANCEL" - ActionDELETE Action = "DELETE" - ActionLASTSTATEUPDATE Action = "LAST_STATE_UPDATE" - ActionLISTSAVEPOINT Action = "LIST_SAVEPOINT" - ActionNEW Action = "NEW" - ActionRELAUNCH Action = "RE_LAUNCH" - ActionSAVEPOINT Action = "SAVEPOINT" - ActionSTART Action = "START" - ActionSTATELESSUPDATE Action = "STATELESS_UPDATE" - ActionSTOP Action = "STOP" - ActionUPDATE Action = "UPDATE" -) - -// PossibleActionValues returns the possible values for the Action const type. -func PossibleActionValues() []Action { - return []Action{ - ActionCANCEL, - ActionDELETE, - ActionLASTSTATEUPDATE, - ActionLISTSAVEPOINT, - ActionNEW, - ActionRELAUNCH, - ActionSAVEPOINT, - ActionSTART, - ActionSTATELESSUPDATE, - ActionSTOP, - ActionUPDATE, - } -} - -// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. -type ActionType string - -const ( - ActionTypeInternal ActionType = "Internal" -) - -// PossibleActionTypeValues returns the possible values for the ActionType const type. -func PossibleActionTypeValues() []ActionType { - return []ActionType{ - ActionTypeInternal, - } -} - -// AutoscaleType - User to specify which type of Autoscale to be implemented - Scheduled Based or Load Based. -type AutoscaleType string - -const ( - AutoscaleTypeLoadBased AutoscaleType = "LoadBased" - AutoscaleTypeScheduleBased AutoscaleType = "ScheduleBased" -) - -// PossibleAutoscaleTypeValues returns the possible values for the AutoscaleType const type. -func PossibleAutoscaleTypeValues() []AutoscaleType { - return []AutoscaleType{ - AutoscaleTypeLoadBased, - AutoscaleTypeScheduleBased, - } -} - -type Category string - -const ( - CategoryCustom Category = "custom" - CategoryPredefined Category = "predefined" -) - -// PossibleCategoryValues returns the possible values for the Category const type. -func PossibleCategoryValues() []Category { - return []Category{ - CategoryCustom, - CategoryPredefined, - } -} - -// ClusterAvailableUpgradeType - Type of upgrade. -type ClusterAvailableUpgradeType string - -const ( - ClusterAvailableUpgradeTypeAKSPatchUpgrade ClusterAvailableUpgradeType = "AKSPatchUpgrade" - ClusterAvailableUpgradeTypeHotfixUpgrade ClusterAvailableUpgradeType = "HotfixUpgrade" - ClusterAvailableUpgradeTypePatchVersionUpgrade ClusterAvailableUpgradeType = "PatchVersionUpgrade" -) - -// PossibleClusterAvailableUpgradeTypeValues returns the possible values for the ClusterAvailableUpgradeType const type. -func PossibleClusterAvailableUpgradeTypeValues() []ClusterAvailableUpgradeType { - return []ClusterAvailableUpgradeType{ - ClusterAvailableUpgradeTypeAKSPatchUpgrade, - ClusterAvailableUpgradeTypeHotfixUpgrade, - ClusterAvailableUpgradeTypePatchVersionUpgrade, - } -} - -// ClusterPoolAvailableUpgradeType - Type of upgrade. -type ClusterPoolAvailableUpgradeType string - -const ( - ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade ClusterPoolAvailableUpgradeType = "AKSPatchUpgrade" - ClusterPoolAvailableUpgradeTypeNodeOsUpgrade ClusterPoolAvailableUpgradeType = "NodeOsUpgrade" -) - -// PossibleClusterPoolAvailableUpgradeTypeValues returns the possible values for the ClusterPoolAvailableUpgradeType const type. -func PossibleClusterPoolAvailableUpgradeTypeValues() []ClusterPoolAvailableUpgradeType { - return []ClusterPoolAvailableUpgradeType{ - ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade, - ClusterPoolAvailableUpgradeTypeNodeOsUpgrade, - } -} - -// ClusterPoolUpgradeHistoryType - Type of upgrade. -type ClusterPoolUpgradeHistoryType string - -const ( - ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade ClusterPoolUpgradeHistoryType = "AKSPatchUpgrade" - ClusterPoolUpgradeHistoryTypeNodeOsUpgrade ClusterPoolUpgradeHistoryType = "NodeOsUpgrade" -) - -// PossibleClusterPoolUpgradeHistoryTypeValues returns the possible values for the ClusterPoolUpgradeHistoryType const type. -func PossibleClusterPoolUpgradeHistoryTypeValues() []ClusterPoolUpgradeHistoryType { - return []ClusterPoolUpgradeHistoryType{ - ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade, - ClusterPoolUpgradeHistoryTypeNodeOsUpgrade, - } -} - -// ClusterPoolUpgradeHistoryUpgradeResultType - Result of this upgrade. -type ClusterPoolUpgradeHistoryUpgradeResultType string - -const ( - ClusterPoolUpgradeHistoryUpgradeResultTypeFailed ClusterPoolUpgradeHistoryUpgradeResultType = "Failed" - ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed ClusterPoolUpgradeHistoryUpgradeResultType = "Succeed" -) - -// PossibleClusterPoolUpgradeHistoryUpgradeResultTypeValues returns the possible values for the ClusterPoolUpgradeHistoryUpgradeResultType const type. -func PossibleClusterPoolUpgradeHistoryUpgradeResultTypeValues() []ClusterPoolUpgradeHistoryUpgradeResultType { - return []ClusterPoolUpgradeHistoryUpgradeResultType{ - ClusterPoolUpgradeHistoryUpgradeResultTypeFailed, - ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed, - } -} - -// ClusterPoolUpgradeType - Type of upgrade. -type ClusterPoolUpgradeType string - -const ( - ClusterPoolUpgradeTypeAKSPatchUpgrade ClusterPoolUpgradeType = "AKSPatchUpgrade" - ClusterPoolUpgradeTypeNodeOsUpgrade ClusterPoolUpgradeType = "NodeOsUpgrade" -) - -// PossibleClusterPoolUpgradeTypeValues returns the possible values for the ClusterPoolUpgradeType const type. -func PossibleClusterPoolUpgradeTypeValues() []ClusterPoolUpgradeType { - return []ClusterPoolUpgradeType{ - ClusterPoolUpgradeTypeAKSPatchUpgrade, - ClusterPoolUpgradeTypeNodeOsUpgrade, - } -} - -// ClusterUpgradeHistorySeverityType - Severity of this upgrade. -type ClusterUpgradeHistorySeverityType string - -const ( - ClusterUpgradeHistorySeverityTypeCritical ClusterUpgradeHistorySeverityType = "critical" - ClusterUpgradeHistorySeverityTypeHigh ClusterUpgradeHistorySeverityType = "high" - ClusterUpgradeHistorySeverityTypeLow ClusterUpgradeHistorySeverityType = "low" - ClusterUpgradeHistorySeverityTypeMedium ClusterUpgradeHistorySeverityType = "medium" -) - -// PossibleClusterUpgradeHistorySeverityTypeValues returns the possible values for the ClusterUpgradeHistorySeverityType const type. -func PossibleClusterUpgradeHistorySeverityTypeValues() []ClusterUpgradeHistorySeverityType { - return []ClusterUpgradeHistorySeverityType{ - ClusterUpgradeHistorySeverityTypeCritical, - ClusterUpgradeHistorySeverityTypeHigh, - ClusterUpgradeHistorySeverityTypeLow, - ClusterUpgradeHistorySeverityTypeMedium, - } -} - -// ClusterUpgradeHistoryType - Type of upgrade. -type ClusterUpgradeHistoryType string - -const ( - ClusterUpgradeHistoryTypeAKSPatchUpgrade ClusterUpgradeHistoryType = "AKSPatchUpgrade" - ClusterUpgradeHistoryTypeHotfixUpgrade ClusterUpgradeHistoryType = "HotfixUpgrade" - ClusterUpgradeHistoryTypeHotfixUpgradeRollback ClusterUpgradeHistoryType = "HotfixUpgradeRollback" - ClusterUpgradeHistoryTypePatchVersionUpgrade ClusterUpgradeHistoryType = "PatchVersionUpgrade" - ClusterUpgradeHistoryTypePatchVersionUpgradeRollback ClusterUpgradeHistoryType = "PatchVersionUpgradeRollback" -) - -// PossibleClusterUpgradeHistoryTypeValues returns the possible values for the ClusterUpgradeHistoryType const type. -func PossibleClusterUpgradeHistoryTypeValues() []ClusterUpgradeHistoryType { - return []ClusterUpgradeHistoryType{ - ClusterUpgradeHistoryTypeAKSPatchUpgrade, - ClusterUpgradeHistoryTypeHotfixUpgrade, - ClusterUpgradeHistoryTypeHotfixUpgradeRollback, - ClusterUpgradeHistoryTypePatchVersionUpgrade, - ClusterUpgradeHistoryTypePatchVersionUpgradeRollback, - } -} - -// ClusterUpgradeHistoryUpgradeResultType - Result of this upgrade. -type ClusterUpgradeHistoryUpgradeResultType string - -const ( - ClusterUpgradeHistoryUpgradeResultTypeFailed ClusterUpgradeHistoryUpgradeResultType = "Failed" - ClusterUpgradeHistoryUpgradeResultTypeSucceed ClusterUpgradeHistoryUpgradeResultType = "Succeed" -) - -// PossibleClusterUpgradeHistoryUpgradeResultTypeValues returns the possible values for the ClusterUpgradeHistoryUpgradeResultType const type. -func PossibleClusterUpgradeHistoryUpgradeResultTypeValues() []ClusterUpgradeHistoryUpgradeResultType { - return []ClusterUpgradeHistoryUpgradeResultType{ - ClusterUpgradeHistoryUpgradeResultTypeFailed, - ClusterUpgradeHistoryUpgradeResultTypeSucceed, - } -} - -// ClusterUpgradeType - Type of upgrade. -type ClusterUpgradeType string - -const ( - ClusterUpgradeTypeAKSPatchUpgrade ClusterUpgradeType = "AKSPatchUpgrade" - ClusterUpgradeTypeHotfixUpgrade ClusterUpgradeType = "HotfixUpgrade" - ClusterUpgradeTypePatchVersionUpgrade ClusterUpgradeType = "PatchVersionUpgrade" -) - -// PossibleClusterUpgradeTypeValues returns the possible values for the ClusterUpgradeType const type. -func PossibleClusterUpgradeTypeValues() []ClusterUpgradeType { - return []ClusterUpgradeType{ - ClusterUpgradeTypeAKSPatchUpgrade, - ClusterUpgradeTypeHotfixUpgrade, - ClusterUpgradeTypePatchVersionUpgrade, - } -} - -// ComparisonOperator - The comparison operator. -type ComparisonOperator string - -const ( - ComparisonOperatorGreaterThan ComparisonOperator = "greaterThan" - ComparisonOperatorGreaterThanOrEqual ComparisonOperator = "greaterThanOrEqual" - ComparisonOperatorLessThan ComparisonOperator = "lessThan" - ComparisonOperatorLessThanOrEqual ComparisonOperator = "lessThanOrEqual" -) - -// PossibleComparisonOperatorValues returns the possible values for the ComparisonOperator const type. -func PossibleComparisonOperatorValues() []ComparisonOperator { - return []ComparisonOperator{ - ComparisonOperatorGreaterThan, - ComparisonOperatorGreaterThanOrEqual, - ComparisonOperatorLessThan, - ComparisonOperatorLessThanOrEqual, - } -} - -// ContentEncoding - This property indicates if the content is encoded and is case-insensitive. Please set the value to base64 -// if the content is base64 encoded. Set it to none or skip it if the content is plain text. -type ContentEncoding string - -const ( - ContentEncodingBase64 ContentEncoding = "Base64" - ContentEncodingNone ContentEncoding = "None" -) - -// PossibleContentEncodingValues returns the possible values for the ContentEncoding const type. -func PossibleContentEncodingValues() []ContentEncoding { - return []ContentEncoding{ - ContentEncodingBase64, - ContentEncodingNone, - } -} - -// CreatedByType - The type of identity that created the resource. -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{ - CreatedByTypeApplication, - CreatedByTypeKey, - CreatedByTypeManagedIdentity, - CreatedByTypeUser, - } -} - -// CurrentClusterAksVersionStatus - Current AKS version's status: whether it is deprecated or supported -type CurrentClusterAksVersionStatus string - -const ( - CurrentClusterAksVersionStatusDeprecated CurrentClusterAksVersionStatus = "Deprecated" - CurrentClusterAksVersionStatusSupported CurrentClusterAksVersionStatus = "Supported" -) - -// PossibleCurrentClusterAksVersionStatusValues returns the possible values for the CurrentClusterAksVersionStatus const type. -func PossibleCurrentClusterAksVersionStatusValues() []CurrentClusterAksVersionStatus { - return []CurrentClusterAksVersionStatus{ - CurrentClusterAksVersionStatusDeprecated, - CurrentClusterAksVersionStatusSupported, - } -} - -// CurrentClusterPoolAksVersionStatus - Current AKS version's status: whether it is deprecated or supported -type CurrentClusterPoolAksVersionStatus string - -const ( - CurrentClusterPoolAksVersionStatusDeprecated CurrentClusterPoolAksVersionStatus = "Deprecated" - CurrentClusterPoolAksVersionStatusSupported CurrentClusterPoolAksVersionStatus = "Supported" -) - -// PossibleCurrentClusterPoolAksVersionStatusValues returns the possible values for the CurrentClusterPoolAksVersionStatus const type. -func PossibleCurrentClusterPoolAksVersionStatusValues() []CurrentClusterPoolAksVersionStatus { - return []CurrentClusterPoolAksVersionStatus{ - CurrentClusterPoolAksVersionStatusDeprecated, - CurrentClusterPoolAksVersionStatusSupported, - } -} - -// DataDiskType - Managed Disk Type. -type DataDiskType string - -const ( - DataDiskTypePremiumSSDLRS DataDiskType = "Premium_SSD_LRS" - DataDiskTypePremiumSSDV2LRS DataDiskType = "Premium_SSD_v2_LRS" - DataDiskTypePremiumSSDZRS DataDiskType = "Premium_SSD_ZRS" - DataDiskTypeStandardHDDLRS DataDiskType = "Standard_HDD_LRS" - DataDiskTypeStandardSSDLRS DataDiskType = "Standard_SSD_LRS" - DataDiskTypeStandardSSDZRS DataDiskType = "Standard_SSD_ZRS" -) - -// PossibleDataDiskTypeValues returns the possible values for the DataDiskType const type. -func PossibleDataDiskTypeValues() []DataDiskType { - return []DataDiskType{ - DataDiskTypePremiumSSDLRS, - DataDiskTypePremiumSSDV2LRS, - DataDiskTypePremiumSSDZRS, - DataDiskTypeStandardHDDLRS, - DataDiskTypeStandardSSDLRS, - DataDiskTypeStandardSSDZRS, - } -} - -// DbConnectionAuthenticationMode - The authentication mode to connect to your Hive metastore database. More details: -// https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization -type DbConnectionAuthenticationMode string - -const ( - // DbConnectionAuthenticationModeIdentityAuth - The managed-identity-based authentication to connect to your Hive metastore - // database. - DbConnectionAuthenticationModeIdentityAuth DbConnectionAuthenticationMode = "IdentityAuth" - // DbConnectionAuthenticationModeSQLAuth - The password-based authentication to connect to your Hive metastore database. - DbConnectionAuthenticationModeSQLAuth DbConnectionAuthenticationMode = "SqlAuth" -) - -// PossibleDbConnectionAuthenticationModeValues returns the possible values for the DbConnectionAuthenticationMode const type. -func PossibleDbConnectionAuthenticationModeValues() []DbConnectionAuthenticationMode { - return []DbConnectionAuthenticationMode{ - DbConnectionAuthenticationModeIdentityAuth, - DbConnectionAuthenticationModeSQLAuth, - } -} - -// DeploymentMode - A string property that indicates the deployment mode of Flink cluster. It can have one of the following -// enum values => Application, Session. Default value is Session -type DeploymentMode string - -const ( - DeploymentModeApplication DeploymentMode = "Application" - DeploymentModeSession DeploymentMode = "Session" -) - -// PossibleDeploymentModeValues returns the possible values for the DeploymentMode const type. -func PossibleDeploymentModeValues() []DeploymentMode { - return []DeploymentMode{ - DeploymentModeApplication, - DeploymentModeSession, - } -} - -// JobType - Type of cluster job. -type JobType string - -const ( - JobTypeFlinkJob JobType = "FlinkJob" -) - -// PossibleJobTypeValues returns the possible values for the JobType const type. -func PossibleJobTypeValues() []JobType { - return []JobType{ - JobTypeFlinkJob, - } -} - -// KeyVaultObjectType - Type of key vault object: secret, key or certificate. -type KeyVaultObjectType string - -const ( - KeyVaultObjectTypeCertificate KeyVaultObjectType = "Certificate" - KeyVaultObjectTypeKey KeyVaultObjectType = "Key" - KeyVaultObjectTypeSecret KeyVaultObjectType = "Secret" -) - -// PossibleKeyVaultObjectTypeValues returns the possible values for the KeyVaultObjectType const type. -func PossibleKeyVaultObjectTypeValues() []KeyVaultObjectType { - return []KeyVaultObjectType{ - KeyVaultObjectTypeCertificate, - KeyVaultObjectTypeKey, - KeyVaultObjectTypeSecret, - } -} - -// LibraryManagementAction - The library management action. -type LibraryManagementAction string - -const ( - LibraryManagementActionInstall LibraryManagementAction = "Install" - LibraryManagementActionUninstall LibraryManagementAction = "Uninstall" -) - -// PossibleLibraryManagementActionValues returns the possible values for the LibraryManagementAction const type. -func PossibleLibraryManagementActionValues() []LibraryManagementAction { - return []LibraryManagementAction{ - LibraryManagementActionInstall, - LibraryManagementActionUninstall, - } -} - -// ManagedIdentityType - The type of managed identity. -type ManagedIdentityType string - -const ( - ManagedIdentityTypeCluster ManagedIdentityType = "cluster" - ManagedIdentityTypeInternal ManagedIdentityType = "internal" - ManagedIdentityTypeUser ManagedIdentityType = "user" -) - -// PossibleManagedIdentityTypeValues returns the possible values for the ManagedIdentityType const type. -func PossibleManagedIdentityTypeValues() []ManagedIdentityType { - return []ManagedIdentityType{ - ManagedIdentityTypeCluster, - ManagedIdentityTypeInternal, - ManagedIdentityTypeUser, - } -} - -// MetastoreDbConnectionAuthenticationMode - The authentication mode to connect to your Hive metastore database. More details: -// https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization -type MetastoreDbConnectionAuthenticationMode string - -const ( - // MetastoreDbConnectionAuthenticationModeIdentityAuth - The managed-identity-based authentication to connect to your Hive - // metastore database. - MetastoreDbConnectionAuthenticationModeIdentityAuth MetastoreDbConnectionAuthenticationMode = "IdentityAuth" - // MetastoreDbConnectionAuthenticationModeSQLAuth - The password-based authentication to connect to your Hive metastore database. - MetastoreDbConnectionAuthenticationModeSQLAuth MetastoreDbConnectionAuthenticationMode = "SqlAuth" -) - -// PossibleMetastoreDbConnectionAuthenticationModeValues returns the possible values for the MetastoreDbConnectionAuthenticationMode const type. -func PossibleMetastoreDbConnectionAuthenticationModeValues() []MetastoreDbConnectionAuthenticationMode { - return []MetastoreDbConnectionAuthenticationMode{ - MetastoreDbConnectionAuthenticationModeIdentityAuth, - MetastoreDbConnectionAuthenticationModeSQLAuth, - } -} - -// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default -// value is "user,system" -type Origin string - -const ( - OriginSystem Origin = "system" - OriginUser Origin = "user" - OriginUserSystem Origin = "user,system" -) - -// PossibleOriginValues returns the possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{ - OriginSystem, - OriginUser, - OriginUserSystem, - } -} - -// OutboundType - This can only be set at cluster pool creation time and cannot be changed later. -type OutboundType string - -const ( - // OutboundTypeLoadBalancer - The load balancer is used for egress through an AKS assigned public IP. This supports Kubernetes - // services of type 'loadBalancer'. - OutboundTypeLoadBalancer OutboundType = "loadBalancer" - // OutboundTypeUserDefinedRouting - Egress paths must be defined by the user. This is an advanced scenario and requires proper - // network configuration. - OutboundTypeUserDefinedRouting OutboundType = "userDefinedRouting" -) - -// PossibleOutboundTypeValues returns the possible values for the OutboundType const type. -func PossibleOutboundTypeValues() []OutboundType { - return []OutboundType{ - OutboundTypeLoadBalancer, - OutboundTypeUserDefinedRouting, - } -} - -// ProvisioningStatus - Provisioning state of the resource. -type ProvisioningStatus string - -const ( - ProvisioningStatusAccepted ProvisioningStatus = "Accepted" - ProvisioningStatusCanceled ProvisioningStatus = "Canceled" - ProvisioningStatusFailed ProvisioningStatus = "Failed" - ProvisioningStatusSucceeded ProvisioningStatus = "Succeeded" -) - -// PossibleProvisioningStatusValues returns the possible values for the ProvisioningStatus const type. -func PossibleProvisioningStatusValues() []ProvisioningStatus { - return []ProvisioningStatus{ - ProvisioningStatusAccepted, - ProvisioningStatusCanceled, - ProvisioningStatusFailed, - ProvisioningStatusSucceeded, - } -} - -// RangerUsersyncMode - User & groups can be synced automatically or via a static list that's refreshed. -type RangerUsersyncMode string - -const ( - RangerUsersyncModeAutomatic RangerUsersyncMode = "automatic" - RangerUsersyncModeStatic RangerUsersyncMode = "static" -) - -// PossibleRangerUsersyncModeValues returns the possible values for the RangerUsersyncMode const type. -func PossibleRangerUsersyncModeValues() []RangerUsersyncMode { - return []RangerUsersyncMode{ - RangerUsersyncModeAutomatic, - RangerUsersyncModeStatic, - } -} - -// ScaleActionType - The action type. -type ScaleActionType string - -const ( - ScaleActionTypeScaledown ScaleActionType = "scaledown" - ScaleActionTypeScaleup ScaleActionType = "scaleup" -) - -// PossibleScaleActionTypeValues returns the possible values for the ScaleActionType const type. -func PossibleScaleActionTypeValues() []ScaleActionType { - return []ScaleActionType{ - ScaleActionTypeScaledown, - ScaleActionTypeScaleup, - } -} - -type ScheduleDay string - -const ( - ScheduleDayFriday ScheduleDay = "Friday" - ScheduleDayMonday ScheduleDay = "Monday" - ScheduleDaySaturday ScheduleDay = "Saturday" - ScheduleDaySunday ScheduleDay = "Sunday" - ScheduleDayThursday ScheduleDay = "Thursday" - ScheduleDayTuesday ScheduleDay = "Tuesday" - ScheduleDayWednesday ScheduleDay = "Wednesday" -) - -// PossibleScheduleDayValues returns the possible values for the ScheduleDay const type. -func PossibleScheduleDayValues() []ScheduleDay { - return []ScheduleDay{ - ScheduleDayFriday, - ScheduleDayMonday, - ScheduleDaySaturday, - ScheduleDaySunday, - ScheduleDayThursday, - ScheduleDayTuesday, - ScheduleDayWednesday, - } -} - -// Severity - Severity of this upgrade. -type Severity string - -const ( - SeverityCritical Severity = "critical" - SeverityHigh Severity = "high" - SeverityLow Severity = "low" - SeverityMedium Severity = "medium" -) - -// PossibleSeverityValues returns the possible values for the Severity const type. -func PossibleSeverityValues() []Severity { - return []Severity{ - SeverityCritical, - SeverityHigh, - SeverityLow, - SeverityMedium, - } -} - -// Status - Status of the library. -type Status string - -const ( - StatusINSTALLED Status = "INSTALLED" - StatusINSTALLFAILED Status = "INSTALL_FAILED" - StatusINSTALLING Status = "INSTALLING" - StatusUNINSTALLFAILED Status = "UNINSTALL_FAILED" - StatusUNINSTALLING Status = "UNINSTALLING" -) - -// PossibleStatusValues returns the possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{ - StatusINSTALLED, - StatusINSTALLFAILED, - StatusINSTALLING, - StatusUNINSTALLFAILED, - StatusUNINSTALLING, - } -} - -// Type - Type of the library. -type Type string - -const ( - TypeMaven Type = "maven" - TypePypi Type = "pypi" -) - -// PossibleTypeValues returns the possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{ - TypeMaven, - TypePypi, - } -} - -// UpgradeMode - A string property that indicates the upgrade mode to be performed on the Flink job. It can have one of the -// following enum values => STATELESSUPDATE, UPDATE, LASTSTATE_UPDATE. -type UpgradeMode string - -const ( - UpgradeModeLASTSTATEUPDATE UpgradeMode = "LAST_STATE_UPDATE" - UpgradeModeSTATELESSUPDATE UpgradeMode = "STATELESS_UPDATE" - UpgradeModeUPDATE UpgradeMode = "UPDATE" -) - -// PossibleUpgradeModeValues returns the possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{ - UpgradeModeLASTSTATEUPDATE, - UpgradeModeSTATELESSUPDATE, - UpgradeModeUPDATE, - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/availableclusterpoolversions_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/availableclusterpoolversions_server.go deleted file mode 100644 index 541ea98b458e..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/availableclusterpoolversions_server.go +++ /dev/null @@ -1,108 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// AvailableClusterPoolVersionsServer is a fake server for instances of the armhdinsightcontainers.AvailableClusterPoolVersionsClient type. -type AvailableClusterPoolVersionsServer struct { - // NewListByLocationPager is the fake for method AvailableClusterPoolVersionsClient.NewListByLocationPager - // HTTP status codes to indicate success: http.StatusOK - NewListByLocationPager func(location string, options *armhdinsightcontainers.AvailableClusterPoolVersionsClientListByLocationOptions) (resp azfake.PagerResponder[armhdinsightcontainers.AvailableClusterPoolVersionsClientListByLocationResponse]) -} - -// NewAvailableClusterPoolVersionsServerTransport creates a new instance of AvailableClusterPoolVersionsServerTransport with the provided implementation. -// The returned AvailableClusterPoolVersionsServerTransport instance is connected to an instance of armhdinsightcontainers.AvailableClusterPoolVersionsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAvailableClusterPoolVersionsServerTransport(srv *AvailableClusterPoolVersionsServer) *AvailableClusterPoolVersionsServerTransport { - return &AvailableClusterPoolVersionsServerTransport{ - srv: srv, - newListByLocationPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.AvailableClusterPoolVersionsClientListByLocationResponse]](), - } -} - -// AvailableClusterPoolVersionsServerTransport connects instances of armhdinsightcontainers.AvailableClusterPoolVersionsClient to instances of AvailableClusterPoolVersionsServer. -// Don't use this type directly, use NewAvailableClusterPoolVersionsServerTransport instead. -type AvailableClusterPoolVersionsServerTransport struct { - srv *AvailableClusterPoolVersionsServer - newListByLocationPager *tracker[azfake.PagerResponder[armhdinsightcontainers.AvailableClusterPoolVersionsClientListByLocationResponse]] -} - -// Do implements the policy.Transporter interface for AvailableClusterPoolVersionsServerTransport. -func (a *AvailableClusterPoolVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "AvailableClusterPoolVersionsClient.NewListByLocationPager": - resp, err = a.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (a *AvailableClusterPoolVersionsServerTransport) dispatchNewListByLocationPager(req *http.Request) (*http.Response, error) { - if a.srv.NewListByLocationPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByLocationPager not implemented")} - } - newListByLocationPager := a.newListByLocationPager.get(req) - if newListByLocationPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/availableClusterPoolVersions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - resp := a.srv.NewListByLocationPager(locationParam, nil) - newListByLocationPager = &resp - a.newListByLocationPager.add(req, newListByLocationPager) - server.PagerResponderInjectNextLinks(newListByLocationPager, req, func(page *armhdinsightcontainers.AvailableClusterPoolVersionsClientListByLocationResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByLocationPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - a.newListByLocationPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByLocationPager) { - a.newListByLocationPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/availableclusterversions_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/availableclusterversions_server.go deleted file mode 100644 index eb21a72f1163..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/availableclusterversions_server.go +++ /dev/null @@ -1,108 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// AvailableClusterVersionsServer is a fake server for instances of the armhdinsightcontainers.AvailableClusterVersionsClient type. -type AvailableClusterVersionsServer struct { - // NewListByLocationPager is the fake for method AvailableClusterVersionsClient.NewListByLocationPager - // HTTP status codes to indicate success: http.StatusOK - NewListByLocationPager func(location string, options *armhdinsightcontainers.AvailableClusterVersionsClientListByLocationOptions) (resp azfake.PagerResponder[armhdinsightcontainers.AvailableClusterVersionsClientListByLocationResponse]) -} - -// NewAvailableClusterVersionsServerTransport creates a new instance of AvailableClusterVersionsServerTransport with the provided implementation. -// The returned AvailableClusterVersionsServerTransport instance is connected to an instance of armhdinsightcontainers.AvailableClusterVersionsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAvailableClusterVersionsServerTransport(srv *AvailableClusterVersionsServer) *AvailableClusterVersionsServerTransport { - return &AvailableClusterVersionsServerTransport{ - srv: srv, - newListByLocationPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.AvailableClusterVersionsClientListByLocationResponse]](), - } -} - -// AvailableClusterVersionsServerTransport connects instances of armhdinsightcontainers.AvailableClusterVersionsClient to instances of AvailableClusterVersionsServer. -// Don't use this type directly, use NewAvailableClusterVersionsServerTransport instead. -type AvailableClusterVersionsServerTransport struct { - srv *AvailableClusterVersionsServer - newListByLocationPager *tracker[azfake.PagerResponder[armhdinsightcontainers.AvailableClusterVersionsClientListByLocationResponse]] -} - -// Do implements the policy.Transporter interface for AvailableClusterVersionsServerTransport. -func (a *AvailableClusterVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "AvailableClusterVersionsClient.NewListByLocationPager": - resp, err = a.dispatchNewListByLocationPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (a *AvailableClusterVersionsServerTransport) dispatchNewListByLocationPager(req *http.Request) (*http.Response, error) { - if a.srv.NewListByLocationPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByLocationPager not implemented")} - } - newListByLocationPager := a.newListByLocationPager.get(req) - if newListByLocationPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/availableClusterVersions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - resp := a.srv.NewListByLocationPager(locationParam, nil) - newListByLocationPager = &resp - a.newListByLocationPager.add(req, newListByLocationPager) - server.PagerResponderInjectNextLinks(newListByLocationPager, req, func(page *armhdinsightcontainers.AvailableClusterVersionsClientListByLocationResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByLocationPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - a.newListByLocationPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByLocationPager) { - a.newListByLocationPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusteravailableupgrades_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusteravailableupgrades_server.go deleted file mode 100644 index b33e63e86b29..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusteravailableupgrades_server.go +++ /dev/null @@ -1,116 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterAvailableUpgradesServer is a fake server for instances of the armhdinsightcontainers.ClusterAvailableUpgradesClient type. -type ClusterAvailableUpgradesServer struct { - // NewListPager is the fake for method ClusterAvailableUpgradesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClusterAvailableUpgradesClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterAvailableUpgradesClientListResponse]) -} - -// NewClusterAvailableUpgradesServerTransport creates a new instance of ClusterAvailableUpgradesServerTransport with the provided implementation. -// The returned ClusterAvailableUpgradesServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterAvailableUpgradesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterAvailableUpgradesServerTransport(srv *ClusterAvailableUpgradesServer) *ClusterAvailableUpgradesServerTransport { - return &ClusterAvailableUpgradesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterAvailableUpgradesClientListResponse]](), - } -} - -// ClusterAvailableUpgradesServerTransport connects instances of armhdinsightcontainers.ClusterAvailableUpgradesClient to instances of ClusterAvailableUpgradesServer. -// Don't use this type directly, use NewClusterAvailableUpgradesServerTransport instead. -type ClusterAvailableUpgradesServerTransport struct { - srv *ClusterAvailableUpgradesServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterAvailableUpgradesClientListResponse]] -} - -// Do implements the policy.Transporter interface for ClusterAvailableUpgradesServerTransport. -func (c *ClusterAvailableUpgradesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterAvailableUpgradesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterAvailableUpgradesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := c.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/availableUpgrades` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListPager(resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - newListPager = &resp - c.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.ClusterAvailableUpgradesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - c.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterjobs_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterjobs_server.go deleted file mode 100644 index 96837ea4b88d..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterjobs_server.go +++ /dev/null @@ -1,189 +0,0 @@ -//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 fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterJobsServer is a fake server for instances of the armhdinsightcontainers.ClusterJobsClient type. -type ClusterJobsServer struct { - // NewListPager is the fake for method ClusterJobsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClusterJobsClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterJobsClientListResponse]) - - // BeginRunJob is the fake for method ClusterJobsClient.BeginRunJob - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginRunJob func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterJob armhdinsightcontainers.ClusterJob, options *armhdinsightcontainers.ClusterJobsClientBeginRunJobOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClusterJobsClientRunJobResponse], errResp azfake.ErrorResponder) -} - -// NewClusterJobsServerTransport creates a new instance of ClusterJobsServerTransport with the provided implementation. -// The returned ClusterJobsServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterJobsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterJobsServerTransport(srv *ClusterJobsServer) *ClusterJobsServerTransport { - return &ClusterJobsServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterJobsClientListResponse]](), - beginRunJob: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClusterJobsClientRunJobResponse]](), - } -} - -// ClusterJobsServerTransport connects instances of armhdinsightcontainers.ClusterJobsClient to instances of ClusterJobsServer. -// Don't use this type directly, use NewClusterJobsServerTransport instead. -type ClusterJobsServerTransport struct { - srv *ClusterJobsServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterJobsClientListResponse]] - beginRunJob *tracker[azfake.PollerResponder[armhdinsightcontainers.ClusterJobsClientRunJobResponse]] -} - -// Do implements the policy.Transporter interface for ClusterJobsServerTransport. -func (c *ClusterJobsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterJobsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ClusterJobsClient.BeginRunJob": - resp, err = c.dispatchBeginRunJob(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterJobsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := c.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/jobs` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) - var options *armhdinsightcontainers.ClusterJobsClientListOptions - if filterParam != nil { - options = &armhdinsightcontainers.ClusterJobsClientListOptions{ - Filter: filterParam, - } - } - resp := c.srv.NewListPager(resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, options) - newListPager = &resp - c.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.ClusterJobsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - c.newListPager.remove(req) - } - return resp, nil -} - -func (c *ClusterJobsServerTransport) dispatchBeginRunJob(req *http.Request) (*http.Response, error) { - if c.srv.BeginRunJob == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginRunJob not implemented")} - } - beginRunJob := c.beginRunJob.get(req) - if beginRunJob == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runJob` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterJob](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginRunJob(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginRunJob = &respr - c.beginRunJob.add(req, beginRunJob) - } - - resp, err := server.PollerResponderNext(beginRunJob, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginRunJob.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginRunJob) { - c.beginRunJob.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterlibraries_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterlibraries_server.go deleted file mode 100644 index 15a3de275ad0..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterlibraries_server.go +++ /dev/null @@ -1,188 +0,0 @@ -//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 fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterLibrariesServer is a fake server for instances of the armhdinsightcontainers.ClusterLibrariesClient type. -type ClusterLibrariesServer struct { - // NewListPager is the fake for method ClusterLibrariesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, clusterPoolName string, clusterName string, category armhdinsightcontainers.Category, options *armhdinsightcontainers.ClusterLibrariesClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterLibrariesClientListResponse]) - - // BeginManageLibraries is the fake for method ClusterLibrariesClient.BeginManageLibraries - // HTTP status codes to indicate success: http.StatusAccepted - BeginManageLibraries func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, operation armhdinsightcontainers.ClusterLibraryManagementOperation, options *armhdinsightcontainers.ClusterLibrariesClientBeginManageLibrariesOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClusterLibrariesClientManageLibrariesResponse], errResp azfake.ErrorResponder) -} - -// NewClusterLibrariesServerTransport creates a new instance of ClusterLibrariesServerTransport with the provided implementation. -// The returned ClusterLibrariesServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterLibrariesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterLibrariesServerTransport(srv *ClusterLibrariesServer) *ClusterLibrariesServerTransport { - return &ClusterLibrariesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterLibrariesClientListResponse]](), - beginManageLibraries: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClusterLibrariesClientManageLibrariesResponse]](), - } -} - -// ClusterLibrariesServerTransport connects instances of armhdinsightcontainers.ClusterLibrariesClient to instances of ClusterLibrariesServer. -// Don't use this type directly, use NewClusterLibrariesServerTransport instead. -type ClusterLibrariesServerTransport struct { - srv *ClusterLibrariesServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterLibrariesClientListResponse]] - beginManageLibraries *tracker[azfake.PollerResponder[armhdinsightcontainers.ClusterLibrariesClientManageLibrariesResponse]] -} - -// Do implements the policy.Transporter interface for ClusterLibrariesServerTransport. -func (c *ClusterLibrariesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterLibrariesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ClusterLibrariesClient.BeginManageLibraries": - resp, err = c.dispatchBeginManageLibraries(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterLibrariesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := c.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/libraries` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - categoryParam, err := parseWithCast(qp.Get("$category"), func(v string) (armhdinsightcontainers.Category, error) { - p, unescapeErr := url.QueryUnescape(v) - if unescapeErr != nil { - return "", unescapeErr - } - return armhdinsightcontainers.Category(p), nil - }) - if err != nil { - return nil, err - } - resp := c.srv.NewListPager(resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, categoryParam, nil) - newListPager = &resp - c.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.ClusterLibrariesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - c.newListPager.remove(req) - } - return resp, nil -} - -func (c *ClusterLibrariesServerTransport) dispatchBeginManageLibraries(req *http.Request) (*http.Response, error) { - if c.srv.BeginManageLibraries == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginManageLibraries not implemented")} - } - beginManageLibraries := c.beginManageLibraries.get(req) - if beginManageLibraries == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/manageLibraries` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterLibraryManagementOperation](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginManageLibraries(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginManageLibraries = &respr - c.beginManageLibraries.add(req, beginManageLibraries) - } - - resp, err := server.PollerResponderNext(beginManageLibraries, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - c.beginManageLibraries.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginManageLibraries) { - c.beginManageLibraries.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpoolavailableupgrades_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpoolavailableupgrades_server.go deleted file mode 100644 index 9ae95f2c6060..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpoolavailableupgrades_server.go +++ /dev/null @@ -1,112 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterPoolAvailableUpgradesServer is a fake server for instances of the armhdinsightcontainers.ClusterPoolAvailableUpgradesClient type. -type ClusterPoolAvailableUpgradesServer struct { - // NewListPager is the fake for method ClusterPoolAvailableUpgradesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, clusterPoolName string, options *armhdinsightcontainers.ClusterPoolAvailableUpgradesClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterPoolAvailableUpgradesClientListResponse]) -} - -// NewClusterPoolAvailableUpgradesServerTransport creates a new instance of ClusterPoolAvailableUpgradesServerTransport with the provided implementation. -// The returned ClusterPoolAvailableUpgradesServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterPoolAvailableUpgradesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterPoolAvailableUpgradesServerTransport(srv *ClusterPoolAvailableUpgradesServer) *ClusterPoolAvailableUpgradesServerTransport { - return &ClusterPoolAvailableUpgradesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolAvailableUpgradesClientListResponse]](), - } -} - -// ClusterPoolAvailableUpgradesServerTransport connects instances of armhdinsightcontainers.ClusterPoolAvailableUpgradesClient to instances of ClusterPoolAvailableUpgradesServer. -// Don't use this type directly, use NewClusterPoolAvailableUpgradesServerTransport instead. -type ClusterPoolAvailableUpgradesServerTransport struct { - srv *ClusterPoolAvailableUpgradesServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolAvailableUpgradesClientListResponse]] -} - -// Do implements the policy.Transporter interface for ClusterPoolAvailableUpgradesServerTransport. -func (c *ClusterPoolAvailableUpgradesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterPoolAvailableUpgradesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterPoolAvailableUpgradesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := c.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/availableUpgrades` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListPager(resourceGroupNameParam, clusterPoolNameParam, nil) - newListPager = &resp - c.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.ClusterPoolAvailableUpgradesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - c.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpools_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpools_server.go deleted file mode 100644 index 4f06640c26fc..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpools_server.go +++ /dev/null @@ -1,409 +0,0 @@ -//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 fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterPoolsServer is a fake server for instances of the armhdinsightcontainers.ClusterPoolsClient type. -type ClusterPoolsServer struct { - // BeginCreateOrUpdate is the fake for method ClusterPoolsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPool armhdinsightcontainers.ClusterPool, options *armhdinsightcontainers.ClusterPoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ClusterPoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, clusterPoolName string, options *armhdinsightcontainers.ClusterPoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ClusterPoolsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, clusterPoolName string, options *armhdinsightcontainers.ClusterPoolsClientGetOptions) (resp azfake.Responder[armhdinsightcontainers.ClusterPoolsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByResourceGroupPager is the fake for method ClusterPoolsClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armhdinsightcontainers.ClusterPoolsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterPoolsClientListByResourceGroupResponse]) - - // NewListBySubscriptionPager is the fake for method ClusterPoolsClient.NewListBySubscriptionPager - // HTTP status codes to indicate success: http.StatusOK - NewListBySubscriptionPager func(options *armhdinsightcontainers.ClusterPoolsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterPoolsClientListBySubscriptionResponse]) - - // BeginUpdateTags is the fake for method ClusterPoolsClient.BeginUpdateTags - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdateTags func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolTags armhdinsightcontainers.TagsObject, options *armhdinsightcontainers.ClusterPoolsClientBeginUpdateTagsOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientUpdateTagsResponse], errResp azfake.ErrorResponder) - - // BeginUpgrade is the fake for method ClusterPoolsClient.BeginUpgrade - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpgrade func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterPoolUpgradeRequest armhdinsightcontainers.ClusterPoolUpgrade, options *armhdinsightcontainers.ClusterPoolsClientBeginUpgradeOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientUpgradeResponse], errResp azfake.ErrorResponder) -} - -// NewClusterPoolsServerTransport creates a new instance of ClusterPoolsServerTransport with the provided implementation. -// The returned ClusterPoolsServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterPoolsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterPoolsServerTransport(srv *ClusterPoolsServer) *ClusterPoolsServerTransport { - return &ClusterPoolsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientDeleteResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolsClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolsClientListBySubscriptionResponse]](), - beginUpdateTags: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientUpdateTagsResponse]](), - beginUpgrade: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientUpgradeResponse]](), - } -} - -// ClusterPoolsServerTransport connects instances of armhdinsightcontainers.ClusterPoolsClient to instances of ClusterPoolsServer. -// Don't use this type directly, use NewClusterPoolsServerTransport instead. -type ClusterPoolsServerTransport struct { - srv *ClusterPoolsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientDeleteResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolsClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolsClientListBySubscriptionResponse]] - beginUpdateTags *tracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientUpdateTagsResponse]] - beginUpgrade *tracker[azfake.PollerResponder[armhdinsightcontainers.ClusterPoolsClientUpgradeResponse]] -} - -// Do implements the policy.Transporter interface for ClusterPoolsServerTransport. -func (c *ClusterPoolsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterPoolsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ClusterPoolsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ClusterPoolsClient.Get": - resp, err = c.dispatchGet(req) - case "ClusterPoolsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ClusterPoolsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "ClusterPoolsClient.BeginUpdateTags": - resp, err = c.dispatchBeginUpdateTags(req) - case "ClusterPoolsClient.BeginUpgrade": - resp, err = c.dispatchBeginUpgrade(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if c.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterPool](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, clusterPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - c.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - c.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if c.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := c.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, clusterPoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - c.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - c.beginDelete.remove(req) - } - - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if c.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, clusterPoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ClusterPool, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := c.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - c.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armhdinsightcontainers.ClusterPoolsClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - c.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListBySubscriptionPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} - } - newListBySubscriptionPager := c.newListBySubscriptionPager.get(req) - if newListBySubscriptionPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := c.srv.NewListBySubscriptionPager(nil) - newListBySubscriptionPager = &resp - c.newListBySubscriptionPager.add(req, newListBySubscriptionPager) - server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armhdinsightcontainers.ClusterPoolsClientListBySubscriptionResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListBySubscriptionPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBySubscriptionPager) { - c.newListBySubscriptionPager.remove(req) - } - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchBeginUpdateTags(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpdateTags == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdateTags not implemented")} - } - beginUpdateTags := c.beginUpdateTags.get(req) - if beginUpdateTags == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.TagsObject](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, clusterPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdateTags = &respr - c.beginUpdateTags.add(req, beginUpdateTags) - } - - resp, err := server.PollerResponderNext(beginUpdateTags, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpdateTags.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdateTags) { - c.beginUpdateTags.remove(req) - } - - return resp, nil -} - -func (c *ClusterPoolsServerTransport) dispatchBeginUpgrade(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpgrade == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpgrade not implemented")} - } - beginUpgrade := c.beginUpgrade.get(req) - if beginUpgrade == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgrade` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterPoolUpgrade](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpgrade(req.Context(), resourceGroupNameParam, clusterPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpgrade = &respr - c.beginUpgrade.add(req, beginUpgrade) - } - - resp, err := server.PollerResponderNext(beginUpgrade, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpgrade.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpgrade) { - c.beginUpgrade.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpoolupgradehistories_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpoolupgradehistories_server.go deleted file mode 100644 index 19af508e9c75..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterpoolupgradehistories_server.go +++ /dev/null @@ -1,112 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterPoolUpgradeHistoriesServer is a fake server for instances of the armhdinsightcontainers.ClusterPoolUpgradeHistoriesClient type. -type ClusterPoolUpgradeHistoriesServer struct { - // NewListPager is the fake for method ClusterPoolUpgradeHistoriesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, clusterPoolName string, options *armhdinsightcontainers.ClusterPoolUpgradeHistoriesClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterPoolUpgradeHistoriesClientListResponse]) -} - -// NewClusterPoolUpgradeHistoriesServerTransport creates a new instance of ClusterPoolUpgradeHistoriesServerTransport with the provided implementation. -// The returned ClusterPoolUpgradeHistoriesServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterPoolUpgradeHistoriesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterPoolUpgradeHistoriesServerTransport(srv *ClusterPoolUpgradeHistoriesServer) *ClusterPoolUpgradeHistoriesServerTransport { - return &ClusterPoolUpgradeHistoriesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolUpgradeHistoriesClientListResponse]](), - } -} - -// ClusterPoolUpgradeHistoriesServerTransport connects instances of armhdinsightcontainers.ClusterPoolUpgradeHistoriesClient to instances of ClusterPoolUpgradeHistoriesServer. -// Don't use this type directly, use NewClusterPoolUpgradeHistoriesServerTransport instead. -type ClusterPoolUpgradeHistoriesServerTransport struct { - srv *ClusterPoolUpgradeHistoriesServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterPoolUpgradeHistoriesClientListResponse]] -} - -// Do implements the policy.Transporter interface for ClusterPoolUpgradeHistoriesServerTransport. -func (c *ClusterPoolUpgradeHistoriesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterPoolUpgradeHistoriesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterPoolUpgradeHistoriesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := c.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgradeHistories` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListPager(resourceGroupNameParam, clusterPoolNameParam, nil) - newListPager = &resp - c.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.ClusterPoolUpgradeHistoriesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - c.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusters_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusters_server.go deleted file mode 100644 index 08d5d19e37b8..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusters_server.go +++ /dev/null @@ -1,661 +0,0 @@ -//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 fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClustersServer is a fake server for instances of the armhdinsightcontainers.ClustersClient type. -type ClustersServer struct { - // BeginCreate is the fake for method ClustersClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreate func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, hdInsightCluster armhdinsightcontainers.Cluster, options *armhdinsightcontainers.ClustersClientBeginCreateOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClustersClientCreateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ClustersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClustersClientBeginDeleteOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClustersClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ClustersClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClustersClientGetOptions) (resp azfake.Responder[armhdinsightcontainers.ClustersClientGetResponse], errResp azfake.ErrorResponder) - - // GetInstanceView is the fake for method ClustersClient.GetInstanceView - // HTTP status codes to indicate success: http.StatusOK - GetInstanceView func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClustersClientGetInstanceViewOptions) (resp azfake.Responder[armhdinsightcontainers.ClustersClientGetInstanceViewResponse], errResp azfake.ErrorResponder) - - // NewListByClusterPoolNamePager is the fake for method ClustersClient.NewListByClusterPoolNamePager - // HTTP status codes to indicate success: http.StatusOK - NewListByClusterPoolNamePager func(resourceGroupName string, clusterPoolName string, options *armhdinsightcontainers.ClustersClientListByClusterPoolNameOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClustersClientListByClusterPoolNameResponse]) - - // NewListInstanceViewsPager is the fake for method ClustersClient.NewListInstanceViewsPager - // HTTP status codes to indicate success: http.StatusOK - NewListInstanceViewsPager func(resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClustersClientListInstanceViewsOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClustersClientListInstanceViewsResponse]) - - // NewListServiceConfigsPager is the fake for method ClustersClient.NewListServiceConfigsPager - // HTTP status codes to indicate success: http.StatusOK - NewListServiceConfigsPager func(resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClustersClientListServiceConfigsOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClustersClientListServiceConfigsResponse]) - - // BeginResize is the fake for method ClustersClient.BeginResize - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResize func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterResizeRequest armhdinsightcontainers.ClusterResizeData, options *armhdinsightcontainers.ClustersClientBeginResizeOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClustersClientResizeResponse], errResp azfake.ErrorResponder) - - // BeginUpdate is the fake for method ClustersClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterPatchRequest armhdinsightcontainers.ClusterPatch, options *armhdinsightcontainers.ClustersClientBeginUpdateOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpdateResponse], errResp azfake.ErrorResponder) - - // BeginUpgrade is the fake for method ClustersClient.BeginUpgrade - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpgrade func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterUpgradeRequest armhdinsightcontainers.ClusterUpgrade, options *armhdinsightcontainers.ClustersClientBeginUpgradeOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpgradeResponse], errResp azfake.ErrorResponder) - - // BeginUpgradeManualRollback is the fake for method ClustersClient.BeginUpgradeManualRollback - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpgradeManualRollback func(ctx context.Context, resourceGroupName string, clusterPoolName string, clusterName string, clusterRollbackUpgradeRequest armhdinsightcontainers.ClusterUpgradeRollback, options *armhdinsightcontainers.ClustersClientBeginUpgradeManualRollbackOptions) (resp azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpgradeManualRollbackResponse], errResp azfake.ErrorResponder) -} - -// NewClustersServerTransport creates a new instance of ClustersServerTransport with the provided implementation. -// The returned ClustersServerTransport instance is connected to an instance of armhdinsightcontainers.ClustersClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClustersServerTransport(srv *ClustersServer) *ClustersServerTransport { - return &ClustersServerTransport{ - srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientCreateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientDeleteResponse]](), - newListByClusterPoolNamePager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClustersClientListByClusterPoolNameResponse]](), - newListInstanceViewsPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClustersClientListInstanceViewsResponse]](), - newListServiceConfigsPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClustersClientListServiceConfigsResponse]](), - beginResize: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientResizeResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpdateResponse]](), - beginUpgrade: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpgradeResponse]](), - beginUpgradeManualRollback: newTracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpgradeManualRollbackResponse]](), - } -} - -// ClustersServerTransport connects instances of armhdinsightcontainers.ClustersClient to instances of ClustersServer. -// Don't use this type directly, use NewClustersServerTransport instead. -type ClustersServerTransport struct { - srv *ClustersServer - beginCreate *tracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientCreateResponse]] - beginDelete *tracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientDeleteResponse]] - newListByClusterPoolNamePager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClustersClientListByClusterPoolNameResponse]] - newListInstanceViewsPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClustersClientListInstanceViewsResponse]] - newListServiceConfigsPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClustersClientListServiceConfigsResponse]] - beginResize *tracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientResizeResponse]] - beginUpdate *tracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpdateResponse]] - beginUpgrade *tracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpgradeResponse]] - beginUpgradeManualRollback *tracker[azfake.PollerResponder[armhdinsightcontainers.ClustersClientUpgradeManualRollbackResponse]] -} - -// Do implements the policy.Transporter interface for ClustersServerTransport. -func (c *ClustersServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClustersClient.BeginCreate": - resp, err = c.dispatchBeginCreate(req) - case "ClustersClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ClustersClient.Get": - resp, err = c.dispatchGet(req) - case "ClustersClient.GetInstanceView": - resp, err = c.dispatchGetInstanceView(req) - case "ClustersClient.NewListByClusterPoolNamePager": - resp, err = c.dispatchNewListByClusterPoolNamePager(req) - case "ClustersClient.NewListInstanceViewsPager": - resp, err = c.dispatchNewListInstanceViewsPager(req) - case "ClustersClient.NewListServiceConfigsPager": - resp, err = c.dispatchNewListServiceConfigsPager(req) - case "ClustersClient.BeginResize": - resp, err = c.dispatchBeginResize(req) - case "ClustersClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - case "ClustersClient.BeginUpgrade": - resp, err = c.dispatchBeginUpgrade(req) - case "ClustersClient.BeginUpgradeManualRollback": - resp, err = c.dispatchBeginUpgradeManualRollback(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClustersServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { - if c.srv.BeginCreate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} - } - beginCreate := c.beginCreate.get(req) - if beginCreate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.Cluster](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginCreate(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreate = &respr - c.beginCreate.add(req, beginCreate) - } - - resp, err := server.PollerResponderNext(beginCreate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - c.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreate) { - c.beginCreate.remove(req) - } - - return resp, nil -} - -func (c *ClustersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if c.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := c.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - c.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - c.beginDelete.remove(req) - } - - return resp, nil -} - -func (c *ClustersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if c.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Cluster, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *ClustersServerTransport) dispatchGetInstanceView(req *http.Request) (*http.Response, error) { - if c.srv.GetInstanceView == nil { - return nil, &nonRetriableError{errors.New("fake for method GetInstanceView not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/instanceViews/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.GetInstanceView(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ClusterInstanceViewResult, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *ClustersServerTransport) dispatchNewListByClusterPoolNamePager(req *http.Request) (*http.Response, error) { - if c.srv.NewListByClusterPoolNamePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByClusterPoolNamePager not implemented")} - } - newListByClusterPoolNamePager := c.newListByClusterPoolNamePager.get(req) - if newListByClusterPoolNamePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListByClusterPoolNamePager(resourceGroupNameParam, clusterPoolNameParam, nil) - newListByClusterPoolNamePager = &resp - c.newListByClusterPoolNamePager.add(req, newListByClusterPoolNamePager) - server.PagerResponderInjectNextLinks(newListByClusterPoolNamePager, req, func(page *armhdinsightcontainers.ClustersClientListByClusterPoolNameResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByClusterPoolNamePager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListByClusterPoolNamePager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByClusterPoolNamePager) { - c.newListByClusterPoolNamePager.remove(req) - } - return resp, nil -} - -func (c *ClustersServerTransport) dispatchNewListInstanceViewsPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListInstanceViewsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListInstanceViewsPager not implemented")} - } - newListInstanceViewsPager := c.newListInstanceViewsPager.get(req) - if newListInstanceViewsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/instanceViews` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListInstanceViewsPager(resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - newListInstanceViewsPager = &resp - c.newListInstanceViewsPager.add(req, newListInstanceViewsPager) - server.PagerResponderInjectNextLinks(newListInstanceViewsPager, req, func(page *armhdinsightcontainers.ClustersClientListInstanceViewsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListInstanceViewsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListInstanceViewsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListInstanceViewsPager) { - c.newListInstanceViewsPager.remove(req) - } - return resp, nil -} - -func (c *ClustersServerTransport) dispatchNewListServiceConfigsPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListServiceConfigsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListServiceConfigsPager not implemented")} - } - newListServiceConfigsPager := c.newListServiceConfigsPager.get(req) - if newListServiceConfigsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/serviceConfigs` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListServiceConfigsPager(resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - newListServiceConfigsPager = &resp - c.newListServiceConfigsPager.add(req, newListServiceConfigsPager) - server.PagerResponderInjectNextLinks(newListServiceConfigsPager, req, func(page *armhdinsightcontainers.ClustersClientListServiceConfigsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListServiceConfigsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListServiceConfigsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListServiceConfigsPager) { - c.newListServiceConfigsPager.remove(req) - } - return resp, nil -} - -func (c *ClustersServerTransport) dispatchBeginResize(req *http.Request) (*http.Response, error) { - if c.srv.BeginResize == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginResize not implemented")} - } - beginResize := c.beginResize.get(req) - if beginResize == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resize` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterResizeData](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginResize(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginResize = &respr - c.beginResize.add(req, beginResize) - } - - resp, err := server.PollerResponderNext(beginResize, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginResize.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginResize) { - c.beginResize.remove(req) - } - - return resp, nil -} - -func (c *ClustersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := c.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterPatch](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpdate(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - c.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - c.beginUpdate.remove(req) - } - - return resp, nil -} - -func (c *ClustersServerTransport) dispatchBeginUpgrade(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpgrade == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpgrade not implemented")} - } - beginUpgrade := c.beginUpgrade.get(req) - if beginUpgrade == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgrade` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterUpgrade](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpgrade(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpgrade = &respr - c.beginUpgrade.add(req, beginUpgrade) - } - - resp, err := server.PollerResponderNext(beginUpgrade, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpgrade.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpgrade) { - c.beginUpgrade.remove(req) - } - - return resp, nil -} - -func (c *ClustersServerTransport) dispatchBeginUpgradeManualRollback(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpgradeManualRollback == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpgradeManualRollback not implemented")} - } - beginUpgradeManualRollback := c.beginUpgradeManualRollback.get(req) - if beginUpgradeManualRollback == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rollback` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.ClusterUpgradeRollback](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpgradeManualRollback(req.Context(), resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpgradeManualRollback = &respr - c.beginUpgradeManualRollback.add(req, beginUpgradeManualRollback) - } - - resp, err := server.PollerResponderNext(beginUpgradeManualRollback, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpgradeManualRollback.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpgradeManualRollback) { - c.beginUpgradeManualRollback.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterupgradehistories_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterupgradehistories_server.go deleted file mode 100644 index 08aa1def6853..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/clusterupgradehistories_server.go +++ /dev/null @@ -1,116 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// ClusterUpgradeHistoriesServer is a fake server for instances of the armhdinsightcontainers.ClusterUpgradeHistoriesClient type. -type ClusterUpgradeHistoriesServer struct { - // NewListPager is the fake for method ClusterUpgradeHistoriesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, clusterPoolName string, clusterName string, options *armhdinsightcontainers.ClusterUpgradeHistoriesClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.ClusterUpgradeHistoriesClientListResponse]) -} - -// NewClusterUpgradeHistoriesServerTransport creates a new instance of ClusterUpgradeHistoriesServerTransport with the provided implementation. -// The returned ClusterUpgradeHistoriesServerTransport instance is connected to an instance of armhdinsightcontainers.ClusterUpgradeHistoriesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewClusterUpgradeHistoriesServerTransport(srv *ClusterUpgradeHistoriesServer) *ClusterUpgradeHistoriesServerTransport { - return &ClusterUpgradeHistoriesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.ClusterUpgradeHistoriesClientListResponse]](), - } -} - -// ClusterUpgradeHistoriesServerTransport connects instances of armhdinsightcontainers.ClusterUpgradeHistoriesClient to instances of ClusterUpgradeHistoriesServer. -// Don't use this type directly, use NewClusterUpgradeHistoriesServerTransport instead. -type ClusterUpgradeHistoriesServerTransport struct { - srv *ClusterUpgradeHistoriesServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.ClusterUpgradeHistoriesClientListResponse]] -} - -// Do implements the policy.Transporter interface for ClusterUpgradeHistoriesServerTransport. -func (c *ClusterUpgradeHistoriesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ClusterUpgradeHistoriesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ClusterUpgradeHistoriesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := c.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/clusterpools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/clusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgradeHistories` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - clusterPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterPoolName")]) - if err != nil { - return nil, err - } - clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListPager(resourceGroupNameParam, clusterPoolNameParam, clusterNameParam, nil) - newListPager = &resp - c.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.ClusterUpgradeHistoriesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - c.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/internal.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/internal.go deleted file mode 100644 index 55ac7c4dc64f..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/internal.go +++ /dev/null @@ -1,80 +0,0 @@ -//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 fake - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "net/http" - "reflect" - "sync" -) - -type nonRetriableError struct { - error -} - -func (nonRetriableError) NonRetriable() { - // marker method -} - -func contains[T comparable](s []T, v T) bool { - for _, vv := range s { - if vv == v { - return true - } - } - return false -} - -func getOptional[T any](v T) *T { - if reflect.ValueOf(v).IsZero() { - return nil - } - return &v -} - -func parseWithCast[T any](v string, parse func(v string) (T, error)) (T, error) { - t, err := parse(v) - if err != nil { - return *new(T), err - } - return t, err -} - -func newTracker[T any]() *tracker[T] { - return &tracker[T]{ - items: map[string]*T{}, - } -} - -type tracker[T any] struct { - items map[string]*T - mu sync.Mutex -} - -func (p *tracker[T]) get(req *http.Request) *T { - p.mu.Lock() - defer p.mu.Unlock() - if item, ok := p.items[server.SanitizePagerPollerPath(req.URL.Path)]; ok { - return item - } - return nil -} - -func (p *tracker[T]) add(req *http.Request, item *T) { - p.mu.Lock() - defer p.mu.Unlock() - p.items[server.SanitizePagerPollerPath(req.URL.Path)] = item -} - -func (p *tracker[T]) remove(req *http.Request) { - p.mu.Lock() - defer p.mu.Unlock() - delete(p.items, server.SanitizePagerPollerPath(req.URL.Path)) -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/locations_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/locations_server.go deleted file mode 100644 index 542640c7483d..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/locations_server.go +++ /dev/null @@ -1,100 +0,0 @@ -//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 fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" - "net/url" - "regexp" -) - -// LocationsServer is a fake server for instances of the armhdinsightcontainers.LocationsClient type. -type LocationsServer struct { - // CheckNameAvailability is the fake for method LocationsClient.CheckNameAvailability - // HTTP status codes to indicate success: http.StatusOK - CheckNameAvailability func(ctx context.Context, location string, nameAvailabilityParameters armhdinsightcontainers.NameAvailabilityParameters, options *armhdinsightcontainers.LocationsClientCheckNameAvailabilityOptions) (resp azfake.Responder[armhdinsightcontainers.LocationsClientCheckNameAvailabilityResponse], errResp azfake.ErrorResponder) -} - -// NewLocationsServerTransport creates a new instance of LocationsServerTransport with the provided implementation. -// The returned LocationsServerTransport instance is connected to an instance of armhdinsightcontainers.LocationsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLocationsServerTransport(srv *LocationsServer) *LocationsServerTransport { - return &LocationsServerTransport{srv: srv} -} - -// LocationsServerTransport connects instances of armhdinsightcontainers.LocationsClient to instances of LocationsServer. -// Don't use this type directly, use NewLocationsServerTransport instead. -type LocationsServerTransport struct { - srv *LocationsServer -} - -// Do implements the policy.Transporter interface for LocationsServerTransport. -func (l *LocationsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "LocationsClient.CheckNameAvailability": - resp, err = l.dispatchCheckNameAvailability(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (l *LocationsServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { - if l.srv.CheckNameAvailability == nil { - return nil, &nonRetriableError{errors.New("fake for method CheckNameAvailability not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.HDInsight/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/checkNameAvailability` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armhdinsightcontainers.NameAvailabilityParameters](req) - if err != nil { - return nil, err - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.CheckNameAvailability(req.Context(), locationParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NameAvailabilityResult, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/operations_server.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/operations_server.go deleted file mode 100644 index 72afb25eb3e7..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/operations_server.go +++ /dev/null @@ -1,96 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" - "net/http" -) - -// OperationsServer is a fake server for instances of the armhdinsightcontainers.OperationsClient type. -type OperationsServer struct { - // NewListPager is the fake for method OperationsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(options *armhdinsightcontainers.OperationsClientListOptions) (resp azfake.PagerResponder[armhdinsightcontainers.OperationsClientListResponse]) -} - -// NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. -// The returned OperationsServerTransport instance is connected to an instance of armhdinsightcontainers.OperationsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { - return &OperationsServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armhdinsightcontainers.OperationsClientListResponse]](), - } -} - -// OperationsServerTransport connects instances of armhdinsightcontainers.OperationsClient to instances of OperationsServer. -// Don't use this type directly, use NewOperationsServerTransport instead. -type OperationsServerTransport struct { - srv *OperationsServer - newListPager *tracker[azfake.PagerResponder[armhdinsightcontainers.OperationsClientListResponse]] -} - -// Do implements the policy.Transporter interface for OperationsServerTransport. -func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if o.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := o.newListPager.get(req) - if newListPager == nil { - resp := o.srv.NewListPager(nil) - newListPager = &resp - o.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armhdinsightcontainers.OperationsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - o.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - o.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/server_factory.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/server_factory.go deleted file mode 100644 index 3e2068ad1e5b..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/server_factory.go +++ /dev/null @@ -1,144 +0,0 @@ -//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 fake - -import ( - "errors" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "strings" - "sync" -) - -// ServerFactory is a fake server for instances of the armhdinsightcontainers.ClientFactory type. -type ServerFactory struct { - AvailableClusterPoolVersionsServer AvailableClusterPoolVersionsServer - AvailableClusterVersionsServer AvailableClusterVersionsServer - ClusterAvailableUpgradesServer ClusterAvailableUpgradesServer - ClusterJobsServer ClusterJobsServer - ClusterLibrariesServer ClusterLibrariesServer - ClusterPoolAvailableUpgradesServer ClusterPoolAvailableUpgradesServer - ClusterPoolUpgradeHistoriesServer ClusterPoolUpgradeHistoriesServer - ClusterPoolsServer ClusterPoolsServer - ClusterUpgradeHistoriesServer ClusterUpgradeHistoriesServer - ClustersServer ClustersServer - LocationsServer LocationsServer - OperationsServer OperationsServer -} - -// NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. -// The returned ServerFactoryTransport instance is connected to an instance of armhdinsightcontainers.ClientFactory via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { - return &ServerFactoryTransport{ - srv: srv, - } -} - -// ServerFactoryTransport connects instances of armhdinsightcontainers.ClientFactory to instances of ServerFactory. -// Don't use this type directly, use NewServerFactoryTransport instead. -type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAvailableClusterPoolVersionsServer *AvailableClusterPoolVersionsServerTransport - trAvailableClusterVersionsServer *AvailableClusterVersionsServerTransport - trClusterAvailableUpgradesServer *ClusterAvailableUpgradesServerTransport - trClusterJobsServer *ClusterJobsServerTransport - trClusterLibrariesServer *ClusterLibrariesServerTransport - trClusterPoolAvailableUpgradesServer *ClusterPoolAvailableUpgradesServerTransport - trClusterPoolUpgradeHistoriesServer *ClusterPoolUpgradeHistoriesServerTransport - trClusterPoolsServer *ClusterPoolsServerTransport - trClusterUpgradeHistoriesServer *ClusterUpgradeHistoriesServerTransport - trClustersServer *ClustersServerTransport - trLocationsServer *LocationsServerTransport - trOperationsServer *OperationsServerTransport -} - -// Do implements the policy.Transporter interface for ServerFactoryTransport. -func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - client := method[:strings.Index(method, ".")] - var resp *http.Response - var err error - - switch client { - case "AvailableClusterPoolVersionsClient": - initServer(s, &s.trAvailableClusterPoolVersionsServer, func() *AvailableClusterPoolVersionsServerTransport { - return NewAvailableClusterPoolVersionsServerTransport(&s.srv.AvailableClusterPoolVersionsServer) - }) - resp, err = s.trAvailableClusterPoolVersionsServer.Do(req) - case "AvailableClusterVersionsClient": - initServer(s, &s.trAvailableClusterVersionsServer, func() *AvailableClusterVersionsServerTransport { - return NewAvailableClusterVersionsServerTransport(&s.srv.AvailableClusterVersionsServer) - }) - resp, err = s.trAvailableClusterVersionsServer.Do(req) - case "ClusterAvailableUpgradesClient": - initServer(s, &s.trClusterAvailableUpgradesServer, func() *ClusterAvailableUpgradesServerTransport { - return NewClusterAvailableUpgradesServerTransport(&s.srv.ClusterAvailableUpgradesServer) - }) - resp, err = s.trClusterAvailableUpgradesServer.Do(req) - case "ClusterJobsClient": - initServer(s, &s.trClusterJobsServer, func() *ClusterJobsServerTransport { return NewClusterJobsServerTransport(&s.srv.ClusterJobsServer) }) - resp, err = s.trClusterJobsServer.Do(req) - case "ClusterLibrariesClient": - initServer(s, &s.trClusterLibrariesServer, func() *ClusterLibrariesServerTransport { - return NewClusterLibrariesServerTransport(&s.srv.ClusterLibrariesServer) - }) - resp, err = s.trClusterLibrariesServer.Do(req) - case "ClusterPoolAvailableUpgradesClient": - initServer(s, &s.trClusterPoolAvailableUpgradesServer, func() *ClusterPoolAvailableUpgradesServerTransport { - return NewClusterPoolAvailableUpgradesServerTransport(&s.srv.ClusterPoolAvailableUpgradesServer) - }) - resp, err = s.trClusterPoolAvailableUpgradesServer.Do(req) - case "ClusterPoolUpgradeHistoriesClient": - initServer(s, &s.trClusterPoolUpgradeHistoriesServer, func() *ClusterPoolUpgradeHistoriesServerTransport { - return NewClusterPoolUpgradeHistoriesServerTransport(&s.srv.ClusterPoolUpgradeHistoriesServer) - }) - resp, err = s.trClusterPoolUpgradeHistoriesServer.Do(req) - case "ClusterPoolsClient": - initServer(s, &s.trClusterPoolsServer, func() *ClusterPoolsServerTransport { return NewClusterPoolsServerTransport(&s.srv.ClusterPoolsServer) }) - resp, err = s.trClusterPoolsServer.Do(req) - case "ClusterUpgradeHistoriesClient": - initServer(s, &s.trClusterUpgradeHistoriesServer, func() *ClusterUpgradeHistoriesServerTransport { - return NewClusterUpgradeHistoriesServerTransport(&s.srv.ClusterUpgradeHistoriesServer) - }) - resp, err = s.trClusterUpgradeHistoriesServer.Do(req) - case "ClustersClient": - initServer(s, &s.trClustersServer, func() *ClustersServerTransport { return NewClustersServerTransport(&s.srv.ClustersServer) }) - resp, err = s.trClustersServer.Do(req) - case "LocationsClient": - initServer(s, &s.trLocationsServer, func() *LocationsServerTransport { return NewLocationsServerTransport(&s.srv.LocationsServer) }) - resp, err = s.trLocationsServer.Do(req) - case "OperationsClient": - initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) - resp, err = s.trOperationsServer.Do(req) - default: - err = fmt.Errorf("unhandled client %s", client) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { - s.trMu.Lock() - if *dst == nil { - *dst = src() - } - s.trMu.Unlock() -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/time_rfc3339.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//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 fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/go.mod b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/go.mod deleted file mode 100644 index 2f3932edf74e..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/go.mod +++ /dev/null @@ -1,21 +0,0 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers - -go 1.23.0 - -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 -) - -require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect -) diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/go.sum b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/go.sum deleted file mode 100644 index 49e874cd7954..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/go.sum +++ /dev/null @@ -1,45 +0,0 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 h1:Wc1ml6QlJs2BHQ/9Bqu1jiyggbsSjramq2oUmp5WeIo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= -github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= -github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/interfaces.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/interfaces.go deleted file mode 100644 index a5c9120340f9..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/interfaces.go +++ /dev/null @@ -1,116 +0,0 @@ -//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 armhdinsightcontainers - -// ClusterAvailableInPlaceUpgradePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterAvailableInPlaceUpgradeProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterAvailableInPlaceUpgradeProperties, *ClusterAvailableUpgradeHotfixUpgradeProperties, *ClusterAvailableUpgradePatchVersionUpgradeProperties -type ClusterAvailableInPlaceUpgradePropertiesClassification interface { - ClusterAvailableUpgradePropertiesClassification - // GetClusterAvailableInPlaceUpgradeProperties returns the ClusterAvailableInPlaceUpgradeProperties content of the underlying type. - GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties -} - -// ClusterAvailableUpgradePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterAvailableUpgradeProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterAvailableInPlaceUpgradeProperties, *ClusterAvailableUpgradeAksPatchUpgradeProperties, *ClusterAvailableUpgradeHotfixUpgradeProperties, -// - *ClusterAvailableUpgradePatchVersionUpgradeProperties, *ClusterAvailableUpgradeProperties -type ClusterAvailableUpgradePropertiesClassification interface { - // GetClusterAvailableUpgradeProperties returns the ClusterAvailableUpgradeProperties content of the underlying type. - GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties -} - -// ClusterInPlaceUpgradeHistoryPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterInPlaceUpgradeHistoryProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterHotfixUpgradeHistoryProperties, *ClusterHotfixUpgradeRollbackHistoryProperties, *ClusterInPlaceUpgradeHistoryProperties, -// - *ClusterPatchVersionUpgradeHistoryProperties, *ClusterPatchVersionUpgradeRollbackHistoryProperties -type ClusterInPlaceUpgradeHistoryPropertiesClassification interface { - ClusterUpgradeHistoryPropertiesClassification - // GetClusterInPlaceUpgradeHistoryProperties returns the ClusterInPlaceUpgradeHistoryProperties content of the underlying type. - GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties -} - -// ClusterInPlaceUpgradePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterInPlaceUpgradeProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterHotfixUpgradeProperties, *ClusterInPlaceUpgradeProperties, *ClusterPatchVersionUpgradeProperties -type ClusterInPlaceUpgradePropertiesClassification interface { - ClusterUpgradePropertiesClassification - // GetClusterInPlaceUpgradeProperties returns the ClusterInPlaceUpgradeProperties content of the underlying type. - GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties -} - -// ClusterJobPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterJobProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterJobProperties, *FlinkJobProperties -type ClusterJobPropertiesClassification interface { - // GetClusterJobProperties returns the ClusterJobProperties content of the underlying type. - GetClusterJobProperties() *ClusterJobProperties -} - -// ClusterLibraryPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterLibraryProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterLibraryProperties, *MavenLibraryProperties, *PyPiLibraryProperties -type ClusterLibraryPropertiesClassification interface { - // GetClusterLibraryProperties returns the ClusterLibraryProperties content of the underlying type. - GetClusterLibraryProperties() *ClusterLibraryProperties -} - -// ClusterPoolAvailableUpgradePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterPoolAvailableUpgradeProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterPoolAvailableUpgradeAksPatchUpgradeProperties, *ClusterPoolAvailableUpgradeNodeOsUpgradeProperties, *ClusterPoolAvailableUpgradeProperties -type ClusterPoolAvailableUpgradePropertiesClassification interface { - // GetClusterPoolAvailableUpgradeProperties returns the ClusterPoolAvailableUpgradeProperties content of the underlying type. - GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties -} - -// ClusterPoolUpgradeHistoryPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterPoolUpgradeHistoryProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterPoolAksPatchUpgradeHistoryProperties, *ClusterPoolNodeOsUpgradeHistoryProperties, *ClusterPoolUpgradeHistoryProperties -type ClusterPoolUpgradeHistoryPropertiesClassification interface { - // GetClusterPoolUpgradeHistoryProperties returns the ClusterPoolUpgradeHistoryProperties content of the underlying type. - GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties -} - -// ClusterPoolUpgradePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterPoolUpgradeProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterPoolAKSPatchVersionUpgradeProperties, *ClusterPoolNodeOsImageUpdateProperties, *ClusterPoolUpgradeProperties -type ClusterPoolUpgradePropertiesClassification interface { - // GetClusterPoolUpgradeProperties returns the ClusterPoolUpgradeProperties content of the underlying type. - GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties -} - -// ClusterUpgradeHistoryPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterUpgradeHistoryProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterAksPatchUpgradeHistoryProperties, *ClusterHotfixUpgradeHistoryProperties, *ClusterHotfixUpgradeRollbackHistoryProperties, -// - *ClusterInPlaceUpgradeHistoryProperties, *ClusterPatchVersionUpgradeHistoryProperties, *ClusterPatchVersionUpgradeRollbackHistoryProperties, -// - *ClusterUpgradeHistoryProperties -type ClusterUpgradeHistoryPropertiesClassification interface { - // GetClusterUpgradeHistoryProperties returns the ClusterUpgradeHistoryProperties content of the underlying type. - GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties -} - -// ClusterUpgradePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetClusterUpgradeProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ClusterAKSPatchVersionUpgradeProperties, *ClusterHotfixUpgradeProperties, *ClusterInPlaceUpgradeProperties, *ClusterPatchVersionUpgradeProperties, -// - *ClusterUpgradeProperties -type ClusterUpgradePropertiesClassification interface { - // GetClusterUpgradeProperties returns the ClusterUpgradeProperties content of the underlying type. - GetClusterUpgradeProperties() *ClusterUpgradeProperties -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/locations_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/locations_client.go deleted file mode 100644 index 86e74eb80fda..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/locations_client.go +++ /dev/null @@ -1,108 +0,0 @@ -//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 armhdinsightcontainers - -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" -) - -// LocationsClient contains the methods for the Locations group. -// Don't use this type directly, use NewLocationsClient() instead. -type LocationsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLocationsClient creates a new instance of LocationsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LocationsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CheckNameAvailability - Check the availability of the resource name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-05-01-preview -// - location - The name of the Azure region. -// - nameAvailabilityParameters - The name and type of the resource. -// - options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability -// method. -func (client *LocationsClient) CheckNameAvailability(ctx context.Context, location string, nameAvailabilityParameters NameAvailabilityParameters, options *LocationsClientCheckNameAvailabilityOptions) (LocationsClientCheckNameAvailabilityResponse, error) { - var err error - const operationName = "LocationsClient.CheckNameAvailability" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.checkNameAvailabilityCreateRequest(ctx, location, nameAvailabilityParameters, options) - if err != nil { - return LocationsClientCheckNameAvailabilityResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LocationsClientCheckNameAvailabilityResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LocationsClientCheckNameAvailabilityResponse{}, err - } - resp, err := client.checkNameAvailabilityHandleResponse(httpResp) - return resp, err -} - -// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *LocationsClient) checkNameAvailabilityCreateRequest(ctx context.Context, location string, nameAvailabilityParameters NameAvailabilityParameters, options *LocationsClientCheckNameAvailabilityOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if location == "" { - return nil, errors.New("parameter location cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, nameAvailabilityParameters); err != nil { - return nil, err - } - return req, nil -} - -// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. -func (client *LocationsClient) checkNameAvailabilityHandleResponse(resp *http.Response) (LocationsClientCheckNameAvailabilityResponse, error) { - result := LocationsClientCheckNameAvailabilityResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailabilityResult); err != nil { - return LocationsClientCheckNameAvailabilityResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/locations_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/locations_client_example_test.go deleted file mode 100644 index 2748fccbd32d..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/locations_client_example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/LocationsNameAvailability.json -func ExampleLocationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, "southeastasia", armhdinsightcontainers.NameAvailabilityParameters{ - Name: to.Ptr("contosemember1"), - Type: to.Ptr("Microsoft.HDInsight/clusterPools/clusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailabilityResult = armhdinsightcontainers.NameAvailabilityResult{ - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/models.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/models.go deleted file mode 100644 index 1d4433026afa..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/models.go +++ /dev/null @@ -1,2591 +0,0 @@ -//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 armhdinsightcontainers - -import "time" - -// AksClusterProfileAksClusterAgentPoolIdentityProfile - Identity properties of the AKS cluster agentpool MSI -type AksClusterProfileAksClusterAgentPoolIdentityProfile struct { - // REQUIRED; ClientId of the MSI. - MsiClientID *string - - // REQUIRED; ObjectId of the MSI. - MsiObjectID *string - - // REQUIRED; ResourceId of the MSI. - MsiResourceID *string -} - -// AuthorizationProfile - Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. -type AuthorizationProfile struct { - // AAD group Ids authorized for data plane access. - GroupIDs []*string - - // AAD user Ids authorized for data plane access. - UserIDs []*string -} - -// AutoscaleProfile - This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with -// Autoscale. -type AutoscaleProfile struct { - // REQUIRED; This indicates whether auto scale is enabled on HDInsight on AKS cluster. - Enabled *bool - - // User to specify which type of Autoscale to be implemented - Scheduled Based or Load Based. - AutoscaleType *AutoscaleType - - // This property is for graceful decommission timeout; It has a default setting of 3600 seconds before forced shutdown takes - // place. This is the maximal time to wait for running containers and - // applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The default value is 3600 seconds. - // Negative value (like -1) is handled as infinite timeout. - GracefulDecommissionTimeout *int32 - - // Profiles of load based Autoscale. - LoadBasedConfig *LoadBasedConfig - - // Profiles of schedule based Autoscale. - ScheduleBasedConfig *ScheduleBasedConfig -} - -// CatalogOptions - Trino cluster catalog options. -type CatalogOptions struct { - // hive catalog options. - Hive []*HiveCatalogOption -} - -// Cluster - The cluster. -type Cluster struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Gets or sets the properties. Define cluster specific properties. - Properties *ClusterResourceProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterAKSPatchVersionUpgradeProperties - Properties of upgrading cluster's AKS patch version. -type ClusterAKSPatchVersionUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeType -} - -// GetClusterUpgradeProperties implements the ClusterUpgradePropertiesClassification interface for type ClusterAKSPatchVersionUpgradeProperties. -func (c *ClusterAKSPatchVersionUpgradeProperties) GetClusterUpgradeProperties() *ClusterUpgradeProperties { - return &ClusterUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterAccessProfile - Cluster access profile. -type ClusterAccessProfile struct { - // REQUIRED; Whether to create cluster using private IP instead of public IP. This property must be set at create time. - EnableInternalIngress *bool - - // READ-ONLY; Private link service resource ID. Only when enableInternalIngress is true, this property will be returned. - PrivateLinkServiceID *string -} - -// ClusterAksPatchUpgradeHistoryProperties - Cluster aks patch upgrade history properties. -type ClusterAksPatchUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType - - // Version going to update. - NewVersion *string - - // Version before update. - OriginalVersion *string -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterAksPatchUpgradeHistoryProperties. -func (c *ClusterAksPatchUpgradeHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return &ClusterUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterAvailableInPlaceUpgradeProperties - Cluster available in-place upgrade. -type ClusterAvailableInPlaceUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterAvailableUpgradeType - - // Name of component to be upgraded. - ComponentName *string - - // Created time of current available upgrade version - CreatedTime *time.Time - - // Hotfix version upgrade description. - Description *string - - // Extended properties of current available upgrade version - ExtendedProperties *string - - // Severity of this upgrade. - Severity *Severity - - // Source build number of current cluster component. - SourceBuildNumber *string - - // Source cluster version of current cluster component. - SourceClusterVersion *string - - // Source OSS version of current cluster component. - SourceOssVersion *string - - // Target build number of component to be upgraded. - TargetBuildNumber *string - - // Target cluster version of component to be upgraded. - TargetClusterVersion *string - - // Target OSS version of component to be upgraded. - TargetOssVersion *string -} - -// GetClusterAvailableInPlaceUpgradeProperties implements the ClusterAvailableInPlaceUpgradePropertiesClassification interface -// for type ClusterAvailableInPlaceUpgradeProperties. -func (c *ClusterAvailableInPlaceUpgradeProperties) GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties { - return c -} - -// GetClusterAvailableUpgradeProperties implements the ClusterAvailableUpgradePropertiesClassification interface for type -// ClusterAvailableInPlaceUpgradeProperties. -func (c *ClusterAvailableInPlaceUpgradeProperties) GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties { - return &ClusterAvailableUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterAvailableUpgrade - Cluster available upgrade. -type ClusterAvailableUpgrade struct { - // Gets or sets the properties. Define cluster upgrade specific properties. - Properties ClusterAvailableUpgradePropertiesClassification - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterAvailableUpgradeAksPatchUpgradeProperties - Cluster available AKS patch version upgrade. -type ClusterAvailableUpgradeAksPatchUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterAvailableUpgradeType - - // Current node pool version. - CurrentVersion *string - - // Current AKS version's status: whether it is deprecated or supported - CurrentVersionStatus *CurrentClusterAksVersionStatus - - // Latest available version, which should be equal to AKS control plane version if it's not deprecated. - LatestVersion *string -} - -// GetClusterAvailableUpgradeProperties implements the ClusterAvailableUpgradePropertiesClassification interface for type -// ClusterAvailableUpgradeAksPatchUpgradeProperties. -func (c *ClusterAvailableUpgradeAksPatchUpgradeProperties) GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties { - return &ClusterAvailableUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterAvailableUpgradeHotfixUpgradeProperties - Cluster available hotfix version upgrade. -type ClusterAvailableUpgradeHotfixUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterAvailableUpgradeType - - // Name of component to be upgraded. - ComponentName *string - - // Created time of current available upgrade version - CreatedTime *time.Time - - // Hotfix version upgrade description. - Description *string - - // Extended properties of current available upgrade version - ExtendedProperties *string - - // Severity of this upgrade. - Severity *Severity - - // Source build number of current cluster component. - SourceBuildNumber *string - - // Source cluster version of current cluster component. - SourceClusterVersion *string - - // Source OSS version of current cluster component. - SourceOssVersion *string - - // Target build number of component to be upgraded. - TargetBuildNumber *string - - // Target cluster version of component to be upgraded. - TargetClusterVersion *string - - // Target OSS version of component to be upgraded. - TargetOssVersion *string -} - -// GetClusterAvailableInPlaceUpgradeProperties implements the ClusterAvailableInPlaceUpgradePropertiesClassification interface -// for type ClusterAvailableUpgradeHotfixUpgradeProperties. -func (c *ClusterAvailableUpgradeHotfixUpgradeProperties) GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties { - return &ClusterAvailableInPlaceUpgradeProperties{ - ComponentName: c.ComponentName, - CreatedTime: c.CreatedTime, - Description: c.Description, - ExtendedProperties: c.ExtendedProperties, - Severity: c.Severity, - SourceBuildNumber: c.SourceBuildNumber, - SourceClusterVersion: c.SourceClusterVersion, - SourceOssVersion: c.SourceOssVersion, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterAvailableUpgradeProperties implements the ClusterAvailableUpgradePropertiesClassification interface for type -// ClusterAvailableUpgradeHotfixUpgradeProperties. -func (c *ClusterAvailableUpgradeHotfixUpgradeProperties) GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties { - return &ClusterAvailableUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterAvailableUpgradeList - Collection of cluster available upgrade. -type ClusterAvailableUpgradeList struct { - // REQUIRED; Collection of Cluster available upgrade. - Value []*ClusterAvailableUpgrade - - // The URL of next result page. - NextLink *string -} - -// ClusterAvailableUpgradePatchVersionUpgradeProperties - Cluster available patch version upgrade. -type ClusterAvailableUpgradePatchVersionUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterAvailableUpgradeType - - // Name of component to be upgraded. - ComponentName *string - - // Created time of current available upgrade version - CreatedTime *time.Time - - // Hotfix version upgrade description. - Description *string - - // Extended properties of current available upgrade version - ExtendedProperties *string - - // Severity of this upgrade. - Severity *Severity - - // Source build number of current cluster component. - SourceBuildNumber *string - - // Source cluster version of current cluster component. - SourceClusterVersion *string - - // Source OSS version of current cluster component. - SourceOssVersion *string - - // Target build number of component to be upgraded. - TargetBuildNumber *string - - // Target cluster version of component to be upgraded. - TargetClusterVersion *string - - // Target OSS version of component to be upgraded. - TargetOssVersion *string -} - -// GetClusterAvailableInPlaceUpgradeProperties implements the ClusterAvailableInPlaceUpgradePropertiesClassification interface -// for type ClusterAvailableUpgradePatchVersionUpgradeProperties. -func (c *ClusterAvailableUpgradePatchVersionUpgradeProperties) GetClusterAvailableInPlaceUpgradeProperties() *ClusterAvailableInPlaceUpgradeProperties { - return &ClusterAvailableInPlaceUpgradeProperties{ - ComponentName: c.ComponentName, - CreatedTime: c.CreatedTime, - Description: c.Description, - ExtendedProperties: c.ExtendedProperties, - Severity: c.Severity, - SourceBuildNumber: c.SourceBuildNumber, - SourceClusterVersion: c.SourceClusterVersion, - SourceOssVersion: c.SourceOssVersion, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterAvailableUpgradeProperties implements the ClusterAvailableUpgradePropertiesClassification interface for type -// ClusterAvailableUpgradePatchVersionUpgradeProperties. -func (c *ClusterAvailableUpgradePatchVersionUpgradeProperties) GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties { - return &ClusterAvailableUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterAvailableUpgradeProperties - Cluster available upgrade properties. -type ClusterAvailableUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterAvailableUpgradeType -} - -// GetClusterAvailableUpgradeProperties implements the ClusterAvailableUpgradePropertiesClassification interface for type -// ClusterAvailableUpgradeProperties. -func (c *ClusterAvailableUpgradeProperties) GetClusterAvailableUpgradeProperties() *ClusterAvailableUpgradeProperties { - return c -} - -type ClusterComponentsItem struct { - Name *string - Version *string -} - -// ClusterConfigFile - Cluster configuration files. -type ClusterConfigFile struct { - // REQUIRED; Configuration file name. - FileName *string - - // Free form content of the entire configuration file. - Content *string - - // This property indicates if the content is encoded and is case-insensitive. Please set the value to base64 if the content - // is base64 encoded. Set it to none or skip it if the content is plain text. - Encoding *ContentEncoding - - // Path of the config file if content is specified. - Path *string - - // List of key value pairs where key represents a valid service configuration name and value represents the value of the config. - Values map[string]*string -} - -// ClusterHotfixUpgradeHistoryProperties - Cluster hotfix upgrade history properties. -type ClusterHotfixUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType - - // Component name to upgrade. - ComponentName *string - - // Severity of this upgrade. - Severity *ClusterUpgradeHistorySeverityType - - // Source build number. - SourceBuildNumber *string - - // Version with three part. - SourceClusterVersion *string - - // Version with three part. - SourceOssVersion *string - - // Target build number. - TargetBuildNumber *string - - // Version with three part. - TargetClusterVersion *string - - // Version with three part. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeHistoryProperties implements the ClusterInPlaceUpgradeHistoryPropertiesClassification interface -// for type ClusterHotfixUpgradeHistoryProperties. -func (c *ClusterHotfixUpgradeHistoryProperties) GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties { - return &ClusterInPlaceUpgradeHistoryProperties{ - ComponentName: c.ComponentName, - Severity: c.Severity, - SourceBuildNumber: c.SourceBuildNumber, - SourceClusterVersion: c.SourceClusterVersion, - SourceOssVersion: c.SourceOssVersion, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterHotfixUpgradeHistoryProperties. -func (c *ClusterHotfixUpgradeHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return &ClusterUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterHotfixUpgradeProperties - Properties of upgrading cluster's hotfix. -type ClusterHotfixUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeType - - // Name of component to be upgraded. - ComponentName *string - - // Target build number of component to be upgraded. - TargetBuildNumber *string - - // Target cluster version of component to be upgraded. - TargetClusterVersion *string - - // Target OSS version of component to be upgraded. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeProperties implements the ClusterInPlaceUpgradePropertiesClassification interface for type ClusterHotfixUpgradeProperties. -func (c *ClusterHotfixUpgradeProperties) GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties { - return &ClusterInPlaceUpgradeProperties{ - ComponentName: c.ComponentName, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterUpgradeProperties implements the ClusterUpgradePropertiesClassification interface for type ClusterHotfixUpgradeProperties. -func (c *ClusterHotfixUpgradeProperties) GetClusterUpgradeProperties() *ClusterUpgradeProperties { - return &ClusterUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterHotfixUpgradeRollbackHistoryProperties - Cluster hotfix upgrade rollback history properties. -type ClusterHotfixUpgradeRollbackHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType - - // Component name to upgrade. - ComponentName *string - - // Severity of this upgrade. - Severity *ClusterUpgradeHistorySeverityType - - // Source build number. - SourceBuildNumber *string - - // Version with three part. - SourceClusterVersion *string - - // Version with three part. - SourceOssVersion *string - - // Target build number. - TargetBuildNumber *string - - // Version with three part. - TargetClusterVersion *string - - // Version with three part. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeHistoryProperties implements the ClusterInPlaceUpgradeHistoryPropertiesClassification interface -// for type ClusterHotfixUpgradeRollbackHistoryProperties. -func (c *ClusterHotfixUpgradeRollbackHistoryProperties) GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties { - return &ClusterInPlaceUpgradeHistoryProperties{ - ComponentName: c.ComponentName, - Severity: c.Severity, - SourceBuildNumber: c.SourceBuildNumber, - SourceClusterVersion: c.SourceClusterVersion, - SourceOssVersion: c.SourceOssVersion, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterHotfixUpgradeRollbackHistoryProperties. -func (c *ClusterHotfixUpgradeRollbackHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return &ClusterUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterInPlaceUpgradeHistoryProperties - Cluster in-place upgrade history properties. -type ClusterInPlaceUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType - - // Component name to upgrade. - ComponentName *string - - // Severity of this upgrade. - Severity *ClusterUpgradeHistorySeverityType - - // Source build number. - SourceBuildNumber *string - - // Version with three part. - SourceClusterVersion *string - - // Version with three part. - SourceOssVersion *string - - // Target build number. - TargetBuildNumber *string - - // Version with three part. - TargetClusterVersion *string - - // Version with three part. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeHistoryProperties implements the ClusterInPlaceUpgradeHistoryPropertiesClassification interface -// for type ClusterInPlaceUpgradeHistoryProperties. -func (c *ClusterInPlaceUpgradeHistoryProperties) GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties { - return c -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterInPlaceUpgradeHistoryProperties. -func (c *ClusterInPlaceUpgradeHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return &ClusterUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterInPlaceUpgradeProperties - Properties of in-place upgrading cluster. -type ClusterInPlaceUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeType - - // Name of component to be upgraded. - ComponentName *string - - // Target build number of component to be upgraded. - TargetBuildNumber *string - - // Target cluster version of component to be upgraded. - TargetClusterVersion *string - - // Target OSS version of component to be upgraded. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeProperties implements the ClusterInPlaceUpgradePropertiesClassification interface for type ClusterInPlaceUpgradeProperties. -func (c *ClusterInPlaceUpgradeProperties) GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties { - return c -} - -// GetClusterUpgradeProperties implements the ClusterUpgradePropertiesClassification interface for type ClusterInPlaceUpgradeProperties. -func (c *ClusterInPlaceUpgradeProperties) GetClusterUpgradeProperties() *ClusterUpgradeProperties { - return &ClusterUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterInstanceViewPropertiesStatus - Status of the instance view. -type ClusterInstanceViewPropertiesStatus struct { - // REQUIRED; The cluster ready status - Ready *string - - // The additional message. - Message *string - - // The status reason. - Reason *string -} - -// ClusterInstanceViewResult - Cluster Instance View. -type ClusterInstanceViewResult struct { - // REQUIRED; Name of the instance view. - Name *string - - // REQUIRED; Properties of the instance view. - Properties *ClusterInstanceViewResultProperties -} - -// ClusterInstanceViewResultProperties - Properties of the instance view. -type ClusterInstanceViewResultProperties struct { - // REQUIRED; List of statuses of relevant services that make up the HDInsight on AKS cluster to surface to the customer. - ServiceStatuses []*ServiceStatus - - // REQUIRED; Status of the instance view. - Status *ClusterInstanceViewPropertiesStatus -} - -// ClusterInstanceViewsResult - The instance view of a HDInsight Cluster. -type ClusterInstanceViewsResult struct { - // Cluster instance view array. - Value []*ClusterInstanceViewResult - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterJob - Cluster job. -type ClusterJob struct { - // REQUIRED; Properties of cluster job. - Properties ClusterJobPropertiesClassification - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterJobList - Collection of cluster job. -type ClusterJobList struct { - // REQUIRED; Collection of cluster job. - Value []*ClusterJob - - // The Url of next result page. - NextLink *string -} - -// ClusterJobProperties - Properties of cluster job. -type ClusterJobProperties struct { - // REQUIRED; Type of cluster job. - JobType *JobType -} - -// GetClusterJobProperties implements the ClusterJobPropertiesClassification interface for type ClusterJobProperties. -func (c *ClusterJobProperties) GetClusterJobProperties() *ClusterJobProperties { return c } - -// ClusterLibrary - Libraries in the cluster. -type ClusterLibrary struct { - // REQUIRED; Properties of a library in the cluster. - Properties ClusterLibraryPropertiesClassification - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterLibraryList - Collection of libraries in the cluster. -type ClusterLibraryList struct { - // REQUIRED; Collection of libraries in the cluster. - Value []*ClusterLibrary - - // READ-ONLY; The url of next result page. - NextLink *string -} - -// ClusterLibraryManagementOperation - Library management operation. -type ClusterLibraryManagementOperation struct { - // REQUIRED; Properties of a library management operation. - Properties *ClusterLibraryManagementOperationProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterLibraryManagementOperationProperties - Properties of a library management operation. -type ClusterLibraryManagementOperationProperties struct { - // REQUIRED; The library management action. - Action *LibraryManagementAction - - // REQUIRED; The libraries to be installed/updated/uninstalled. - Libraries []*ClusterLibrary -} - -// ClusterLibraryProperties - Properties of a library in the cluster. -type ClusterLibraryProperties struct { - // REQUIRED; Type of the library. - Type *Type - - // Remark of the latest library management operation. - Remarks *string - - // READ-ONLY; Error message of the library operation when a failure occurs. - Message *string - - // READ-ONLY; Status of the library. - Status *Status - - // READ-ONLY; Timestamp of the latest library management operation. - Timestamp *time.Time -} - -// GetClusterLibraryProperties implements the ClusterLibraryPropertiesClassification interface for type ClusterLibraryProperties. -func (c *ClusterLibraryProperties) GetClusterLibraryProperties() *ClusterLibraryProperties { return c } - -// ClusterListResult - The list cluster operation response. -type ClusterListResult struct { - // The list of clusters. - Value []*Cluster - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterLogAnalyticsApplicationLogs - Collection of logs to be enabled or disabled for log analytics. -type ClusterLogAnalyticsApplicationLogs struct { - // True if stderror is enabled, otherwise false. - StdErrorEnabled *bool - - // True if stdout is enabled, otherwise false. - StdOutEnabled *bool -} - -// ClusterLogAnalyticsProfile - Cluster log analytics profile to enable or disable OMS agent for cluster. -type ClusterLogAnalyticsProfile struct { - // REQUIRED; True if log analytics is enabled for the cluster, otherwise false. - Enabled *bool - - // Collection of logs to be enabled or disabled for log analytics. - ApplicationLogs *ClusterLogAnalyticsApplicationLogs - - // True if metrics are enabled, otherwise false. - MetricsEnabled *bool -} - -// ClusterPatch - The patch for a cluster. -type ClusterPatch struct { - // Define cluster patch specific properties. - Properties *ClusterPatchProperties - - // Resource tags. - Tags map[string]*string -} - -// ClusterPatchProperties - Cluster resource patch data. -type ClusterPatchProperties struct { - // Cluster resource patch properties. - ClusterProfile *UpdatableClusterProfile -} - -// ClusterPatchVersionUpgradeHistoryProperties - Cluster patch version upgrade history properties. -type ClusterPatchVersionUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType - - // Component name to upgrade. - ComponentName *string - - // Severity of this upgrade. - Severity *ClusterUpgradeHistorySeverityType - - // Source build number. - SourceBuildNumber *string - - // Version with three part. - SourceClusterVersion *string - - // Version with three part. - SourceOssVersion *string - - // Target build number. - TargetBuildNumber *string - - // Version with three part. - TargetClusterVersion *string - - // Version with three part. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeHistoryProperties implements the ClusterInPlaceUpgradeHistoryPropertiesClassification interface -// for type ClusterPatchVersionUpgradeHistoryProperties. -func (c *ClusterPatchVersionUpgradeHistoryProperties) GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties { - return &ClusterInPlaceUpgradeHistoryProperties{ - ComponentName: c.ComponentName, - Severity: c.Severity, - SourceBuildNumber: c.SourceBuildNumber, - SourceClusterVersion: c.SourceClusterVersion, - SourceOssVersion: c.SourceOssVersion, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterPatchVersionUpgradeHistoryProperties. -func (c *ClusterPatchVersionUpgradeHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return &ClusterUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterPatchVersionUpgradeProperties - Properties of upgrading cluster's patch version. -type ClusterPatchVersionUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeType - - // Name of component to be upgraded. - ComponentName *string - - // Target build number of component to be upgraded. - TargetBuildNumber *string - - // Target cluster version of component to be upgraded. - TargetClusterVersion *string - - // Target OSS version of component to be upgraded. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeProperties implements the ClusterInPlaceUpgradePropertiesClassification interface for type ClusterPatchVersionUpgradeProperties. -func (c *ClusterPatchVersionUpgradeProperties) GetClusterInPlaceUpgradeProperties() *ClusterInPlaceUpgradeProperties { - return &ClusterInPlaceUpgradeProperties{ - ComponentName: c.ComponentName, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterUpgradeProperties implements the ClusterUpgradePropertiesClassification interface for type ClusterPatchVersionUpgradeProperties. -func (c *ClusterPatchVersionUpgradeProperties) GetClusterUpgradeProperties() *ClusterUpgradeProperties { - return &ClusterUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterPatchVersionUpgradeRollbackHistoryProperties - Cluster patch version upgrade rollback history properties. -type ClusterPatchVersionUpgradeRollbackHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType - - // Component name to upgrade. - ComponentName *string - - // Severity of this upgrade. - Severity *ClusterUpgradeHistorySeverityType - - // Source build number. - SourceBuildNumber *string - - // Version with three part. - SourceClusterVersion *string - - // Version with three part. - SourceOssVersion *string - - // Target build number. - TargetBuildNumber *string - - // Version with three part. - TargetClusterVersion *string - - // Version with three part. - TargetOssVersion *string -} - -// GetClusterInPlaceUpgradeHistoryProperties implements the ClusterInPlaceUpgradeHistoryPropertiesClassification interface -// for type ClusterPatchVersionUpgradeRollbackHistoryProperties. -func (c *ClusterPatchVersionUpgradeRollbackHistoryProperties) GetClusterInPlaceUpgradeHistoryProperties() *ClusterInPlaceUpgradeHistoryProperties { - return &ClusterInPlaceUpgradeHistoryProperties{ - ComponentName: c.ComponentName, - Severity: c.Severity, - SourceBuildNumber: c.SourceBuildNumber, - SourceClusterVersion: c.SourceClusterVersion, - SourceOssVersion: c.SourceOssVersion, - TargetBuildNumber: c.TargetBuildNumber, - TargetClusterVersion: c.TargetClusterVersion, - TargetOssVersion: c.TargetOssVersion, - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterPatchVersionUpgradeRollbackHistoryProperties. -func (c *ClusterPatchVersionUpgradeRollbackHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return &ClusterUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterPool - Cluster pool. -type ClusterPool struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Gets or sets the properties. Define cluster pool specific properties. - Properties *ClusterPoolResourceProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterPoolAKSPatchVersionUpgradeProperties - Properties of upgrading cluster pool's AKS patch version. -type ClusterPoolAKSPatchVersionUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolUpgradeType - - // Target AKS version. When it's not set, latest version will be used. When upgradeClusterPool is true and upgradeAllClusterNodes - // is false, target version should be greater or equal to current version. - // When upgradeClusterPool is false and upgradeAllClusterNodes is true, target version should be equal to AKS version of cluster - // pool. - TargetAksVersion *string - - // whether upgrade all clusters' nodes. If it's true, upgradeClusterPool should be false. - UpgradeAllClusterNodes *bool - - // whether upgrade cluster pool or not. If it's true, upgradeAllClusterNodes should be false. - UpgradeClusterPool *bool -} - -// GetClusterPoolUpgradeProperties implements the ClusterPoolUpgradePropertiesClassification interface for type ClusterPoolAKSPatchVersionUpgradeProperties. -func (c *ClusterPoolAKSPatchVersionUpgradeProperties) GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties { - return &ClusterPoolUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterPoolAksPatchUpgradeHistoryProperties - Cluster pool aks upgrade history properties. -type ClusterPoolAksPatchUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterPoolUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolUpgradeHistoryType - - // Version going to update. - NewVersion *string - - // Version before update. - OriginalVersion *string - - // Whether upgrade all cluster nodes. - UpgradeAllClusterNodes *bool - - // Whether upgrade cluster pool. - UpgradeClusterPool *bool -} - -// GetClusterPoolUpgradeHistoryProperties implements the ClusterPoolUpgradeHistoryPropertiesClassification interface for type -// ClusterPoolAksPatchUpgradeHistoryProperties. -func (c *ClusterPoolAksPatchUpgradeHistoryProperties) GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties { - return &ClusterPoolUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterPoolAvailableUpgrade - Cluster pool available upgrade. -type ClusterPoolAvailableUpgrade struct { - // Gets or sets the properties. Define cluster pool upgrade specific properties. - Properties ClusterPoolAvailableUpgradePropertiesClassification - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterPoolAvailableUpgradeAksPatchUpgradeProperties - Cluster pool available AKS patch version upgrade. -type ClusterPoolAvailableUpgradeAksPatchUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolAvailableUpgradeType - - // Current AKS version. - CurrentVersion *string - - // Current AKS version's status: whether it is deprecated or supported - CurrentVersionStatus *CurrentClusterPoolAksVersionStatus - - // Latest AKS patch version. - LatestVersion *string -} - -// GetClusterPoolAvailableUpgradeProperties implements the ClusterPoolAvailableUpgradePropertiesClassification interface for -// type ClusterPoolAvailableUpgradeAksPatchUpgradeProperties. -func (c *ClusterPoolAvailableUpgradeAksPatchUpgradeProperties) GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties { - return &ClusterPoolAvailableUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterPoolAvailableUpgradeList - collection of cluster pool available upgrade. -type ClusterPoolAvailableUpgradeList struct { - // REQUIRED; Collection of cluster pool available upgrade. - Value []*ClusterPoolAvailableUpgrade - - // The Url of next result page. - NextLink *string -} - -// ClusterPoolAvailableUpgradeNodeOsUpgradeProperties - Cluster pool available node OS update. -type ClusterPoolAvailableUpgradeNodeOsUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolAvailableUpgradeType - - // The latest node OS version. - LatestVersion *string -} - -// GetClusterPoolAvailableUpgradeProperties implements the ClusterPoolAvailableUpgradePropertiesClassification interface for -// type ClusterPoolAvailableUpgradeNodeOsUpgradeProperties. -func (c *ClusterPoolAvailableUpgradeNodeOsUpgradeProperties) GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties { - return &ClusterPoolAvailableUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterPoolAvailableUpgradeProperties - Cluster pool available upgrade properties. -type ClusterPoolAvailableUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolAvailableUpgradeType -} - -// GetClusterPoolAvailableUpgradeProperties implements the ClusterPoolAvailableUpgradePropertiesClassification interface for -// type ClusterPoolAvailableUpgradeProperties. -func (c *ClusterPoolAvailableUpgradeProperties) GetClusterPoolAvailableUpgradeProperties() *ClusterPoolAvailableUpgradeProperties { - return c -} - -// ClusterPoolListResult - The list cluster pools operation response. -type ClusterPoolListResult struct { - // The list of cluster pools. - Value []*ClusterPool - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterPoolNodeOsImageUpdateProperties - Properties of upgrading cluster pool's AKS patch version. -type ClusterPoolNodeOsImageUpdateProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolUpgradeType -} - -// GetClusterPoolUpgradeProperties implements the ClusterPoolUpgradePropertiesClassification interface for type ClusterPoolNodeOsImageUpdateProperties. -func (c *ClusterPoolNodeOsImageUpdateProperties) GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties { - return &ClusterPoolUpgradeProperties{ - UpgradeType: c.UpgradeType, - } -} - -// ClusterPoolNodeOsUpgradeHistoryProperties - Cluster pool node os upgrade history properties. -type ClusterPoolNodeOsUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterPoolUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolUpgradeHistoryType - - // New Node Os version. - NewNodeOs *string -} - -// GetClusterPoolUpgradeHistoryProperties implements the ClusterPoolUpgradeHistoryPropertiesClassification interface for type -// ClusterPoolNodeOsUpgradeHistoryProperties. -func (c *ClusterPoolNodeOsUpgradeHistoryProperties) GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties { - return &ClusterPoolUpgradeHistoryProperties{ - UTCTime: c.UTCTime, - UpgradeResult: c.UpgradeResult, - UpgradeType: c.UpgradeType, - } -} - -// ClusterPoolResourceProperties - Cluster pool resource properties. -type ClusterPoolResourceProperties struct { - // REQUIRED; CLuster pool compute profile. - ComputeProfile *ClusterPoolResourcePropertiesComputeProfile - - // CLuster pool profile. - ClusterPoolProfile *ClusterPoolResourcePropertiesClusterPoolProfile - - // Cluster pool log analytics profile to enable OMS agent for AKS cluster. - LogAnalyticsProfile *ClusterPoolResourcePropertiesLogAnalyticsProfile - - // A resource group created by RP, to hold the resources created by RP on-behalf of customers. It will also be used to generate - // aksManagedResourceGroupName by pattern: MC{managedResourceGroupName} - // {clusterPoolName}_{region}. Please make sure it meets resource group name restriction. - ManagedResourceGroupName *string - - // Cluster pool network profile. - NetworkProfile *ClusterPoolResourcePropertiesNetworkProfile - - // READ-ONLY; Properties of underlying AKS cluster. - AksClusterProfile *ClusterPoolResourcePropertiesAksClusterProfile - - // READ-ONLY; A resource group created by AKS, to hold the infrastructure resources created by AKS on-behalf of customers. - // It is generated by cluster pool name and managed resource group name by pattern: MC - // {managedResourceGroupName}{clusterPoolName}_{region} - AksManagedResourceGroupName *string - - // READ-ONLY; A unique id generated by the RP to identify the resource. - DeploymentID *string - - // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningStatus - - // READ-ONLY; Business status of the resource. - Status *string -} - -// ClusterPoolResourcePropertiesAksClusterProfile - Properties of underlying AKS cluster. -type ClusterPoolResourcePropertiesAksClusterProfile struct { - // Identity properties of the AKS cluster agentpool MSI - AksClusterAgentPoolIdentityProfile *AksClusterProfileAksClusterAgentPoolIdentityProfile - - // ARM Resource ID of the AKS cluster - AksClusterResourceID *string - - // READ-ONLY; AKS control plane and default node pool version of this ClusterPool - AksVersion *string -} - -// ClusterPoolResourcePropertiesClusterPoolProfile - CLuster pool profile. -type ClusterPoolResourcePropertiesClusterPoolProfile struct { - // REQUIRED; Cluster pool version is a 2-part version. - ClusterPoolVersion *string - - // Gets or sets the IP tag for the public IPs created along with the HDInsightOnAks ClusterPools and Clusters. - PublicIPTag *IPTag -} - -// ClusterPoolResourcePropertiesComputeProfile - CLuster pool compute profile. -type ClusterPoolResourcePropertiesComputeProfile struct { - // REQUIRED; The virtual machine SKU. - VMSize *string - - // The list of Availability zones to use for AKS VMSS nodes. - AvailabilityZones []*string - - // READ-ONLY; The number of virtual machines. - Count *int32 -} - -// ClusterPoolResourcePropertiesLogAnalyticsProfile - Cluster pool log analytics profile to enable OMS agent for AKS cluster. -type ClusterPoolResourcePropertiesLogAnalyticsProfile struct { - // REQUIRED; True if log analytics is enabled for cluster pool, otherwise false. - Enabled *bool - - // Log analytics workspace to associate with the OMS agent. - WorkspaceID *string -} - -// ClusterPoolResourcePropertiesNetworkProfile - Cluster pool network profile. -type ClusterPoolResourcePropertiesNetworkProfile struct { - // REQUIRED; Cluster pool subnet resource id. - SubnetID *string - - // IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with private AKS clusters. - // So you cannot set enablePrivateApiServer to true and - // apiServerAuthorizedIpRanges at the same time. Currently, this property is not supported and please don't use it. - APIServerAuthorizedIPRanges []*string - - // ClusterPool is based on AKS cluster. AKS cluster exposes the API server to public internet by default. If you set this - // property to true, a private AKS cluster will be created, and it will use private - // apiserver, which is not exposed to public internet. - EnablePrivateAPIServer *bool - - // This can only be set at cluster pool creation time and cannot be changed later. - OutboundType *OutboundType -} - -// ClusterPoolUpgrade - Cluster Pool Upgrade. -type ClusterPoolUpgrade struct { - // REQUIRED; Properties of upgrading cluster pool. - Properties ClusterPoolUpgradePropertiesClassification -} - -// ClusterPoolUpgradeHistory - Cluster pool upgrade history. -type ClusterPoolUpgradeHistory struct { - // REQUIRED; Properties of cluster pool upgrade history. - Properties ClusterPoolUpgradeHistoryPropertiesClassification - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterPoolUpgradeHistoryListResult - Represents a list of cluster pool upgrade history. -type ClusterPoolUpgradeHistoryListResult struct { - // REQUIRED; The list of cluster pool upgrade history. - Value []*ClusterPoolUpgradeHistory - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterPoolUpgradeHistoryProperties - Properties of cluster pool upgrade history. -type ClusterPoolUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterPoolUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolUpgradeHistoryType -} - -// GetClusterPoolUpgradeHistoryProperties implements the ClusterPoolUpgradeHistoryPropertiesClassification interface for type -// ClusterPoolUpgradeHistoryProperties. -func (c *ClusterPoolUpgradeHistoryProperties) GetClusterPoolUpgradeHistoryProperties() *ClusterPoolUpgradeHistoryProperties { - return c -} - -// ClusterPoolUpgradeProperties - Properties of upgrading cluster pool. -type ClusterPoolUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterPoolUpgradeType -} - -// GetClusterPoolUpgradeProperties implements the ClusterPoolUpgradePropertiesClassification interface for type ClusterPoolUpgradeProperties. -func (c *ClusterPoolUpgradeProperties) GetClusterPoolUpgradeProperties() *ClusterPoolUpgradeProperties { - return c -} - -// ClusterPoolVersion - Available cluster pool version. -type ClusterPoolVersion struct { - // Cluster pool version properties. - Properties *ClusterPoolVersionProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterPoolVersionProperties - Cluster pool version properties. -type ClusterPoolVersionProperties struct { - // AKS version. - AksVersion *string - - // Cluster pool version is a 2-part version. - ClusterPoolVersion *string - - // Indicate if this version is in preview or not. - IsPreview *bool -} - -// ClusterPoolVersionsListResult - Represents a list of cluster pool versions. -type ClusterPoolVersionsListResult struct { - // The list of cluster pool versions. - Value []*ClusterPoolVersion - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterProfile - Cluster profile. -type ClusterProfile struct { - // REQUIRED; Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. - AuthorizationProfile *AuthorizationProfile - - // REQUIRED; Version with 3/4 part. - ClusterVersion *string - - // REQUIRED; Version with three part. - OssVersion *string - - // This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. - AutoscaleProfile *AutoscaleProfile - - // Cluster access profile. - ClusterAccessProfile *ClusterAccessProfile - - // The Flink cluster profile. - FlinkProfile *FlinkProfile - - // This is deprecated. Please use managed identity profile instead. - IdentityProfile *IdentityProfile - - // The Kafka cluster profile. - KafkaProfile *KafkaProfile - - // LLAP cluster profile. - LlapProfile map[string]any - - // Cluster log analytics profile to enable or disable OMS agent for cluster. - LogAnalyticsProfile *ClusterLogAnalyticsProfile - - // This property is required by Trino, Spark and Flink cluster but is optional for Kafka cluster. - ManagedIdentityProfile *ManagedIdentityProfile - - // Cluster Prometheus profile. - PrometheusProfile *ClusterPrometheusProfile - - // Cluster Ranger plugin profile. - RangerPluginProfile *ClusterRangerPluginProfile - - // The ranger cluster profile. - RangerProfile *RangerProfile - - // Ssh profile for the cluster. - SSHProfile *SSHProfile - - // The script action profile list. - ScriptActionProfiles []*ScriptActionProfile - - // The cluster secret profile. - SecretsProfile *SecretsProfile - - // The service configs profiles. - ServiceConfigsProfiles []*ClusterServiceConfigsProfile - - // The spark cluster profile. - SparkProfile *SparkProfile - - // Stub cluster profile. - StubProfile map[string]any - - // Trino Cluster profile. - TrinoProfile *TrinoProfile - - // READ-ONLY; Component list of this cluster type and version. - Components []*ClusterComponentsItem - - // READ-ONLY; Cluster connectivity profile. - ConnectivityProfile *ConnectivityProfile -} - -// ClusterPrometheusProfile - Cluster Prometheus profile. -type ClusterPrometheusProfile struct { - // REQUIRED; Enable Prometheus for cluster or not. - Enabled *bool -} - -// ClusterRangerPluginProfile - Cluster Ranger plugin profile. -type ClusterRangerPluginProfile struct { - // REQUIRED; Enable Ranger for cluster or not. - Enabled *bool -} - -// ClusterResizeData - The parameters for resizing a cluster. -type ClusterResizeData struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Sets the properties. Define cluster resize specific properties. - Properties *ClusterResizeProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterResizeProperties - The properties for resizing a cluster. -type ClusterResizeProperties struct { - // REQUIRED; Target node count of worker node. - TargetWorkerNodeCount *int32 -} - -// ClusterResourceProperties - Cluster resource properties. -type ClusterResourceProperties struct { - // REQUIRED; Cluster profile. - ClusterProfile *ClusterProfile - - // REQUIRED; The type of cluster. - ClusterType *string - - // REQUIRED; The compute profile. - ComputeProfile *ComputeProfile - - // READ-ONLY; A unique id generated by the RP to identify the resource. - DeploymentID *string - - // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningStatus - - // READ-ONLY; Business status of the resource. - Status *string -} - -// ClusterServiceConfig - Cluster configs per component. -type ClusterServiceConfig struct { - // REQUIRED; Name of the component the config files should apply to. - Component *string - - // REQUIRED; List of Config Files. - Files []*ClusterConfigFile -} - -// ClusterServiceConfigsProfile - Cluster service configs. -type ClusterServiceConfigsProfile struct { - // REQUIRED; List of service configs. - Configs []*ClusterServiceConfig - - // REQUIRED; Name of the service the configurations should apply to. - ServiceName *string -} - -// ClusterUpgrade - Cluster Upgrade. -type ClusterUpgrade struct { - // REQUIRED; Properties of upgrading cluster. - Properties ClusterUpgradePropertiesClassification -} - -// ClusterUpgradeHistory - Cluster upgrade history. -type ClusterUpgradeHistory struct { - // REQUIRED; Properties of cluster upgrade history. - Properties ClusterUpgradeHistoryPropertiesClassification - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterUpgradeHistoryListResult - Represents a list of cluster upgrade history. -type ClusterUpgradeHistoryListResult struct { - // REQUIRED; The list of cluster upgrade history. - Value []*ClusterUpgradeHistory - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterUpgradeHistoryProperties - Properties of cluster upgrade history. -type ClusterUpgradeHistoryProperties struct { - // REQUIRED; Time when created this upgrade history. - UTCTime *string - - // REQUIRED; Result of this upgrade. - UpgradeResult *ClusterUpgradeHistoryUpgradeResultType - - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeHistoryType -} - -// GetClusterUpgradeHistoryProperties implements the ClusterUpgradeHistoryPropertiesClassification interface for type ClusterUpgradeHistoryProperties. -func (c *ClusterUpgradeHistoryProperties) GetClusterUpgradeHistoryProperties() *ClusterUpgradeHistoryProperties { - return c -} - -// ClusterUpgradeProperties - Properties of upgrading cluster. -type ClusterUpgradeProperties struct { - // REQUIRED; Type of upgrade. - UpgradeType *ClusterUpgradeType -} - -// GetClusterUpgradeProperties implements the ClusterUpgradePropertiesClassification interface for type ClusterUpgradeProperties. -func (c *ClusterUpgradeProperties) GetClusterUpgradeProperties() *ClusterUpgradeProperties { return c } - -// ClusterUpgradeRollback - Cluster Upgrade. -type ClusterUpgradeRollback struct { - // REQUIRED; Properties for manual rollback of cluster's upgrade. - Properties *ClusterUpgradeRollbackProperties -} - -// ClusterUpgradeRollbackProperties - Properties for manual rollback of cluster's upgrade. -type ClusterUpgradeRollbackProperties struct { - // REQUIRED; A specific upgrade history to rollback - UpgradeHistory *string -} - -// ClusterVersion - Available cluster version. -type ClusterVersion struct { - // Cluster version properties. - Properties *ClusterVersionProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ClusterVersionProperties - Cluster version properties. -type ClusterVersionProperties struct { - // The two part cluster pool version. If the cluster version is before cluster pool version on-board, the return value will - // be empty string - ClusterPoolVersion *string - - // The type of cluster. - ClusterType *string - - // Version with three part. - ClusterVersion *string - - // Indicate if this version is in preview or not. - IsPreview *bool - - // Version with three part. - OssVersion *string - - // READ-ONLY; Component list of this cluster type and version. - Components []*ClusterComponentsItem -} - -// ClusterVersionsListResult - Represents a list of cluster versions. -type ClusterVersionsListResult struct { - // The list of cluster versions. - Value []*ClusterVersion - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ComparisonRule - The comparison rule. -type ComparisonRule struct { - // REQUIRED; The comparison operator. - Operator *ComparisonOperator - - // REQUIRED; Threshold setting. - Threshold *float32 -} - -// ComputeProfile - The compute profile. -type ComputeProfile struct { - // REQUIRED; The nodes definitions. - Nodes []*NodeProfile - - // The list of Availability zones to use for AKS VMSS nodes. - AvailabilityZones []*string -} - -// ComputeResourceDefinition - The cpu and memory requirement definition. -type ComputeResourceDefinition struct { - // REQUIRED; The required CPU. - CPU *float32 - - // REQUIRED; The required memory in MB, Container memory will be 110 percentile - Memory *int64 -} - -// ConnectivityProfile - Cluster connectivity profile. -type ConnectivityProfile struct { - // REQUIRED; Web connectivity endpoint details. - Web *ConnectivityProfileWeb - - // List of SSH connectivity endpoints. - SSH []*SSHConnectivityEndpoint -} - -// ConnectivityProfileWeb - Web connectivity endpoint details. -type ConnectivityProfileWeb struct { - // REQUIRED; Web connectivity endpoint. - Fqdn *string - - // Private web connectivity endpoint. This property will only be returned when enableInternalIngress is true. - PrivateFqdn *string -} - -// DiskStorageProfile - Kafka disk storage profile. -type DiskStorageProfile struct { - // REQUIRED; Managed Disk size in GB. The maximum supported disk size for Standard and Premium HDD/SSD is 32TB, except for - // Premium SSD v2, which supports up to 64TB. - DataDiskSize *int32 - - // REQUIRED; Managed Disk Type. - DataDiskType *DataDiskType -} - -// FlinkCatalogOptions - Flink cluster catalog options. -type FlinkCatalogOptions struct { - // Hive Catalog Option for Flink cluster. - Hive *FlinkHiveCatalogOption -} - -// FlinkHiveCatalogOption - Hive Catalog Option for Flink cluster. -type FlinkHiveCatalogOption struct { - // REQUIRED; Connection string for hive metastore database. - MetastoreDbConnectionURL *string - - // The authentication mode to connect to your Hive metastore database. More details: - // https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization - MetastoreDbConnectionAuthenticationMode *MetastoreDbConnectionAuthenticationMode - - // Secret reference name from secretsProfile.secrets containing password for database connection. - MetastoreDbConnectionPasswordSecret *string - - // User name for database connection. - MetastoreDbConnectionUserName *string -} - -// FlinkJobProfile - Job specifications for flink clusters in application deployment mode. The specification is immutable -// even if job properties are changed by calling the RunJob API, please use the ListJob API to get the -// latest job information. -type FlinkJobProfile struct { - // REQUIRED; A string property that represents the name of the job JAR. - JarName *string - - // REQUIRED; A string property that specifies the directory where the job JAR is located. - JobJarDirectory *string - - // REQUIRED; A string property that indicates the upgrade mode to be performed on the Flink job. It can have one of the following - // enum values => STATELESSUPDATE, UPDATE, LASTSTATE_UPDATE. - UpgradeMode *UpgradeMode - - // A string property representing additional JVM arguments for the Flink job. It should be space separated value. - Args *string - - // A string property that specifies the entry class for the Flink job. If not specified, the entry point is auto-detected - // from the flink job jar package. - EntryClass *string - - // A string property that represents the name of the savepoint for the Flink job - SavePointName *string -} - -// FlinkJobProperties - Properties of flink job. -type FlinkJobProperties struct { - // REQUIRED; Type of cluster job. - JobType *JobType - - // A string property that indicates the action to be performed on the Flink job. It can have one of the following enum values - // => NEW, UPDATE, STATELESSUPDATE, STOP, START, CANCEL, SAVEPOINT, LIST - // SAVEPOINT, or DELETE. - Action *Action - - // A string property representing additional JVM arguments for the Flink job. It should be space separated value. - Args *string - - // A string property that specifies the entry class for the Flink job. - EntryClass *string - - // Additional properties used to configure Flink jobs. It allows users to set properties such as parallelism and jobSavePointDirectory. - // It accepts additional key-value pairs as properties, where the keys - // are strings and the values are strings as well. - FlinkConfiguration map[string]*string - - // A string property that represents the name of the job JAR. - JarName *string - - // A string property that specifies the directory where the job JAR is located. - JobJarDirectory *string - - // Name of job - JobName *string - - // Run id of job - RunID *string - - // A string property that represents the name of the savepoint for the Flink job - SavePointName *string - - // READ-ONLY; Action result of job. - ActionResult *string - - // READ-ONLY; Unique id for identifying a job - JobID *string - - // READ-ONLY; Output of job. - JobOutput *string - - // READ-ONLY; The last savepoint. - LastSavePoint *string - - // READ-ONLY; Status of job. - Status *string -} - -// GetClusterJobProperties implements the ClusterJobPropertiesClassification interface for type FlinkJobProperties. -func (f *FlinkJobProperties) GetClusterJobProperties() *ClusterJobProperties { - return &ClusterJobProperties{ - JobType: f.JobType, - } -} - -// FlinkProfile - The Flink cluster profile. -type FlinkProfile struct { - // REQUIRED; Job Manager container/ process CPU and memory requirements - JobManager *ComputeResourceDefinition - - // REQUIRED; The storage profile - Storage *FlinkStorageProfile - - // REQUIRED; Task Manager container/ process CPU and memory requirements - TaskManager *ComputeResourceDefinition - - // Flink cluster catalog options. - CatalogOptions *FlinkCatalogOptions - - // A string property that indicates the deployment mode of Flink cluster. It can have one of the following enum values => - // Application, Session. Default value is Session - DeploymentMode *DeploymentMode - - // History Server container/ process CPU and memory requirements - HistoryServer *ComputeResourceDefinition - - // Job specifications for flink clusters in application deployment mode. The specification is immutable even if job properties - // are changed by calling the RunJob API, please use the ListJob API to get the - // latest job information. - JobSpec *FlinkJobProfile - - // The number of task managers. - NumReplicas *int32 -} - -// FlinkStorageProfile - The storage profile -type FlinkStorageProfile struct { - // REQUIRED; Storage account uri which is used for savepoint and checkpoint state. - StorageURI *string - - // Storage key is only required for wasb(s) storage. - Storagekey *string -} - -// HiveCatalogOption - Hive Catalog Option -type HiveCatalogOption struct { - // REQUIRED; Name of trino catalog which should use specified hive metastore. - CatalogName *string - - // REQUIRED; Connection string for hive metastore database. - MetastoreDbConnectionURL *string - - // REQUIRED; Metastore root directory URI, format: abfs[s]://@.dfs.core.windows.net/. More details: https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri - MetastoreWarehouseDir *string - - // The authentication mode to connect to your Hive metastore database. More details: - // https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization - MetastoreDbConnectionAuthenticationMode *MetastoreDbConnectionAuthenticationMode - - // Secret reference name from secretsProfile.secrets containing password for database connection. - MetastoreDbConnectionPasswordSecret *string - - // User name for database connection. - MetastoreDbConnectionUserName *string -} - -// IPTag - Contains the IpTag associated with the public IP address -type IPTag struct { - // REQUIRED; Gets or sets the ipTag type: Example FirstPartyUsage. - IPTagType *string - - // REQUIRED; Gets or sets value of the IpTag associated with the public IP. Example HDInsight, SQL, Storage etc - Tag *string -} - -// IdentityProfile - Identity Profile with details of an MSI. -type IdentityProfile struct { - // REQUIRED; ClientId of the MSI. - MsiClientID *string - - // REQUIRED; ObjectId of the MSI. - MsiObjectID *string - - // REQUIRED; ResourceId of the MSI. - MsiResourceID *string -} - -// KafkaConnectivityEndpoints - Kafka bootstrap server and broker related connectivity endpoints. -type KafkaConnectivityEndpoints struct { - // bootstrap server connectivity endpoint. - BootstrapServerEndpoint *string - - // Kafka broker endpoint list. - BrokerEndpoints []*string -} - -// KafkaProfile - The Kafka cluster profile. -type KafkaProfile struct { - // REQUIRED; Kafka disk storage profile. - DiskStorage *DiskStorageProfile - - // Expose Kafka cluster in KRaft mode. - EnableKRaft *bool - - // Expose worker nodes as public endpoints. - EnablePublicEndpoints *bool - - // Fully qualified path of Azure Storage container used for Tiered Storage. - RemoteStorageURI *string - - // READ-ONLY; Kafka bootstrap server and brokers related connectivity endpoints. - ConnectivityEndpoints *KafkaConnectivityEndpoints -} - -// LoadBasedConfig - Profile of load based Autoscale. -type LoadBasedConfig struct { - // REQUIRED; User needs to set the maximum number of nodes for load based scaling, the load based scaling will use this to - // scale up and scale down between minimum and maximum number of nodes. - MaxNodes *int32 - - // REQUIRED; User needs to set the minimum number of nodes for load based scaling, the load based scaling will use this to - // scale up and scale down between minimum and maximum number of nodes. - MinNodes *int32 - - // REQUIRED; The scaling rules. - ScalingRules []*ScalingRule - - // This is a cool down period, this is a time period in seconds, which determines the amount of time that must elapse between - // a scaling activity started by a rule and the start of the next scaling - // activity, regardless of the rule that triggers it. The default value is 300 seconds. - CooldownPeriod *int32 - - // User can specify the poll interval, this is the time period (in seconds) after which scaling metrics are polled for triggering - // a scaling operation. - PollInterval *int32 -} - -// ManagedIdentityProfile - The details of managed identity. -type ManagedIdentityProfile struct { - // REQUIRED; The list of managed identity. - IdentityList []*ManagedIdentitySpec -} - -// ManagedIdentitySpec - The details of a managed identity. -type ManagedIdentitySpec struct { - // REQUIRED; ClientId of the managed identity. - ClientID *string - - // REQUIRED; ObjectId of the managed identity. - ObjectID *string - - // REQUIRED; ResourceId of the managed identity. - ResourceID *string - - // REQUIRED; The type of managed identity. - Type *ManagedIdentityType -} - -// MavenLibraryProperties - Properties of a Maven library in the cluster. -type MavenLibraryProperties struct { - // REQUIRED; GroupId of the Maven package. - GroupID *string - - // REQUIRED; ArtifactId of the Maven package. - Name *string - - // REQUIRED; Type of the library. - Type *Type - - // Remark of the latest library management operation. - Remarks *string - - // Version of the Maven package. - Version *string - - // READ-ONLY; Error message of the library operation when a failure occurs. - Message *string - - // READ-ONLY; Status of the library. - Status *Status - - // READ-ONLY; Timestamp of the latest library management operation. - Timestamp *time.Time -} - -// GetClusterLibraryProperties implements the ClusterLibraryPropertiesClassification interface for type MavenLibraryProperties. -func (m *MavenLibraryProperties) GetClusterLibraryProperties() *ClusterLibraryProperties { - return &ClusterLibraryProperties{ - Message: m.Message, - Remarks: m.Remarks, - Status: m.Status, - Timestamp: m.Timestamp, - Type: m.Type, - } -} - -// NameAvailabilityParameters - Details of check name availability request body. -type NameAvailabilityParameters struct { - // Name for checking availability. - Name *string - - // The resource type in Microsoft.HDInsight. - Type *string -} - -// NameAvailabilityResult - Result of check name availability. -type NameAvailabilityResult struct { - // The error message of unavailability. - Message *string - - // Indicator of availability of the Microsoft.HDInsight resource name. - NameAvailable *bool - - // The reason of unavailability. - Reason *string -} - -// NodeProfile - The node profile. -type NodeProfile struct { - // REQUIRED; The number of virtual machines. - Count *int32 - - // REQUIRED; The node type. - Type *string - - // REQUIRED; The virtual machine SKU. - VMSize *string -} - -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API -type Operation struct { - // Localized display information for this particular operation. - Display *OperationDisplay - - // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType - - // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane - // operations. - IsDataAction *bool - - // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", - // "Microsoft.Compute/virtualMachines/capture/action" - Name *string - - // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - // value is "user,system" - Origin *Origin -} - -// OperationDisplay - Localized display information for this particular operation. -type OperationDisplay struct { - // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string - - // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - // Machine", "Restart Virtual Machine". - Operation *string - - // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - // Compute". - Provider *string - - // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - // Schedule Collections". - Resource *string -} - -// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to -// get the next set of results. -type OperationListResult struct { - // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string - - // READ-ONLY; List of operations supported by the resource provider - Value []*Operation -} - -// PyPiLibraryProperties - Properties of a PyPi library in the cluster. -type PyPiLibraryProperties struct { - // REQUIRED; Name of the PyPi package. - Name *string - - // REQUIRED; Type of the library. - Type *Type - - // Remark of the latest library management operation. - Remarks *string - - // Version of the PyPi package. - Version *string - - // READ-ONLY; Error message of the library operation when a failure occurs. - Message *string - - // READ-ONLY; Status of the library. - Status *Status - - // READ-ONLY; Timestamp of the latest library management operation. - Timestamp *time.Time -} - -// GetClusterLibraryProperties implements the ClusterLibraryPropertiesClassification interface for type PyPiLibraryProperties. -func (p *PyPiLibraryProperties) GetClusterLibraryProperties() *ClusterLibraryProperties { - return &ClusterLibraryProperties{ - Message: p.Message, - Remarks: p.Remarks, - Status: p.Status, - Timestamp: p.Timestamp, - Type: p.Type, - } -} - -// RangerAdminSpec - Specification for the Ranger Admin service. -type RangerAdminSpec struct { - // REQUIRED; List of usernames that should be marked as ranger admins. These usernames should match the user principal name - // (UPN) of the respective AAD users. - Admins []*string - - // REQUIRED - Database *RangerAdminSpecDatabase -} - -type RangerAdminSpecDatabase struct { - // REQUIRED; The database URL - Host *string - - // REQUIRED; The database name - Name *string - - // Reference for the database password - PasswordSecretRef *string - - // The name of the database user - Username *string -} - -// RangerAuditSpec - Properties required to describe audit log storage. -type RangerAuditSpec struct { - // Azure storage location of the blobs. MSI should have read/write access to this Storage account. - StorageAccount *string -} - -// RangerProfile - The ranger cluster profile. -type RangerProfile struct { - // REQUIRED; Specification for the Ranger Admin service. - RangerAdmin *RangerAdminSpec - - // REQUIRED; Specification for the Ranger Usersync service - RangerUsersync *RangerUsersyncSpec - - // Properties required to describe audit log storage. - RangerAudit *RangerAuditSpec -} - -// RangerUsersyncSpec - Specification for the Ranger Usersync service -type RangerUsersyncSpec struct { - // Denotes whether usersync service should be enabled - Enabled *bool - - // List of groups that should be synced. These group names should match the object id of the respective AAD groups. - Groups []*string - - // User & groups can be synced automatically or via a static list that's refreshed. - Mode *RangerUsersyncMode - - // Azure storage location of a mapping file that lists user & group associations. - UserMappingLocation *string - - // List of user names that should be synced. These usernames should match the User principal name of the respective AAD users. - Users []*string -} - -// SSHConnectivityEndpoint - SSH connectivity endpoint details. -type SSHConnectivityEndpoint struct { - // REQUIRED; SSH connectivity endpoint. - Endpoint *string - - // Private SSH connectivity endpoint. This property will only be returned when enableInternalIngress is true. - PrivateSSHEndpoint *string -} - -// SSHProfile - Ssh profile for the cluster. -type SSHProfile struct { - // REQUIRED; Number of ssh pods per cluster. - Count *int32 - - // The virtual machine SKU. - VMSize *string - - // READ-ONLY; Prefix of the pod names. Pod number will be appended to the prefix. The ingress URLs for the pods will be available - // at //- - PodPrefix *string -} - -// ScalingRule - The scaling rule. -type ScalingRule struct { - // REQUIRED; The action type. - ActionType *ScaleActionType - - // REQUIRED; The comparison rule. - ComparisonRule *ComparisonRule - - // REQUIRED; This is an evaluation count for a scaling condition, the number of times a trigger condition should be successful, - // before scaling activity is triggered. - EvaluationCount *int32 - - // REQUIRED; Metrics name for individual workloads. For example: cpu - ScalingMetric *string -} - -// Schedule definition. -type Schedule struct { - // REQUIRED; User has to set the node count anticipated at end of the scaling operation of the set current schedule configuration, - // format is integer. - Count *int32 - - // REQUIRED; User has to set the days where schedule has to be set for autoscale operation. - Days []*ScheduleDay - - // REQUIRED; User has to set the end time of current schedule configuration, format like 10:30 (HH:MM). - EndTime *string - - // REQUIRED; User has to set the start time of current schedule configuration, format like 10:30 (HH:MM). - StartTime *string -} - -// ScheduleBasedConfig - Profile of schedule based Autoscale. -type ScheduleBasedConfig struct { - // REQUIRED; Setting default node count of current schedule configuration. Default node count specifies the number of nodes - // which are default when an specified scaling operation is executed (scale up/scale down) - DefaultCount *int32 - - // REQUIRED; This specifies the schedules where scheduled based Autoscale to be enabled, the user has a choice to set multiple - // rules within the schedule across days and times (start/end). - Schedules []*Schedule - - // REQUIRED; User has to specify the timezone on which the schedule has to be set for schedule based autoscale configuration. - TimeZone *string -} - -// ScriptActionProfile - The script action profile. -type ScriptActionProfile struct { - // REQUIRED; Script name. - Name *string - - // REQUIRED; List of services to apply the script action. - Services []*string - - // REQUIRED; Type of the script action. Supported type is bash scripts. - Type *string - - // REQUIRED; Url of the script file. - URL *string - - // Additional parameters for the script action. It should be space-separated list of arguments required for script execution. - Parameters *string - - // Specify if the script should persist on the cluster. - ShouldPersist *bool - - // Timeout duration for the script action in minutes. - TimeoutInMinutes *int32 -} - -// SecretReference - Secret reference and corresponding properties of a key vault secret. -type SecretReference struct { - // REQUIRED; Object identifier name of the secret in key vault. - KeyVaultObjectName *string - - // REQUIRED; Reference name of the secret to be used in service configs. - ReferenceName *string - - // REQUIRED; Type of key vault object: secret, key or certificate. - Type *KeyVaultObjectType - - // Version of the secret in key vault. - Version *string -} - -// SecretsProfile - The cluster secret profile. -type SecretsProfile struct { - // REQUIRED; Name of the user Key Vault where all the cluster specific user secrets are stored. - KeyVaultResourceID *string - - // Properties of Key Vault secret. - Secrets []*SecretReference -} - -// ServiceConfigListResult - Cluster instance service configs api response. -type ServiceConfigListResult struct { - // Cluster instance service config array. - Value []*ServiceConfigResult - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ServiceConfigListResultValueEntity - Default config details. -type ServiceConfigListResultValueEntity struct { - // REQUIRED; Config value. - Value *string - - // Config description. - Description *string -} - -// ServiceConfigResult - Cluster instance service config. -type ServiceConfigResult struct { - // Cluster instance service config properties. - Properties *ServiceConfigResultProperties -} - -// ServiceConfigResultProperties - Cluster instance service config properties. -type ServiceConfigResultProperties struct { - // REQUIRED; Component Name. - ComponentName *string - - // REQUIRED; File Name. - FileName *string - - // REQUIRED; Service Config Name. - ServiceName *string - - // Content in the service config file. - Content *string - - // The custom keys. - CustomKeys map[string]*string - - // The default keys. - DefaultKeys map[string]*ServiceConfigListResultValueEntity - - // Config file path. - Path *string - - // Config type. - Type *string -} - -// ServiceStatus - Describes the status of a service of a HDInsight on AKS cluster. -type ServiceStatus struct { - // REQUIRED; Kind of the service. E.g. "Zookeeper". - Kind *string - - // REQUIRED; Indicates if the service is ready / healthy. Values can be "true", "false", "unknown" or anything else. - Ready *string - - // A message describing the error if any. - Message *string -} - -// SparkMetastoreSpec - The metastore specification for Spark cluster. -type SparkMetastoreSpec struct { - // REQUIRED; The database name. - DbName *string - - // REQUIRED; The database server host. - DbServerHost *string - - // The authentication mode to connect to your Hive metastore database. More details: - // https://learn.microsoft.com/en-us/azure/azure-sql/database/logins-create-manage?view=azuresql#authentication-and-authorization - DbConnectionAuthenticationMode *DbConnectionAuthenticationMode - - // The secret name which contains the database user password. - DbPasswordSecretName *string - - // The database user name. - DbUserName *string - - // The key vault resource id. - KeyVaultID *string - - // The thrift url. - ThriftURL *string -} - -// SparkProfile - The spark cluster profile. -type SparkProfile struct { - // The default storage URL. - DefaultStorageURL *string - - // The metastore specification for Spark cluster. - MetastoreSpec *SparkMetastoreSpec - - // Spark user plugins spec - UserPluginsSpec *SparkUserPlugins -} - -// SparkUserPlugin - Spark user plugin. -type SparkUserPlugin struct { - // REQUIRED; Fully qualified path to the folder containing the plugins. - Path *string -} - -// SparkUserPlugins - Spark user plugins spec -type SparkUserPlugins struct { - // Spark user plugins. - Plugins []*SparkUserPlugin -} - -// SystemData - Metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // The timestamp of resource creation (UTC). - CreatedAt *time.Time - - // The identity that created the resource. - CreatedBy *string - - // The type of identity that created the resource. - CreatedByType *CreatedByType - - // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time - - // The identity that last modified the resource. - LastModifiedBy *string - - // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType -} - -// TagsObject - Tags object for patch operations. -type TagsObject struct { - // Resource tags. - Tags map[string]*string -} - -// TrinoCoordinator - Trino Coordinator. -type TrinoCoordinator struct { - // Trino debug configuration. - Debug *TrinoDebugConfig - - // The flag that if enable coordinator HA, uses multiple coordinator replicas with auto failover, one per each head node. - // Default: true. - HighAvailabilityEnabled *bool -} - -// TrinoDebugConfig - Trino debug configuration. -type TrinoDebugConfig struct { - // The flag that if enable debug or not. - Enable *bool - - // The debug port. - Port *int32 - - // The flag that if suspend debug or not. - Suspend *bool -} - -// TrinoProfile - Trino Cluster profile. -type TrinoProfile struct { - // Trino cluster catalog options. - CatalogOptions *CatalogOptions - - // Trino Coordinator. - Coordinator *TrinoCoordinator - - // Trino user plugins spec - UserPluginsSpec *TrinoUserPlugins - - // User telemetry - UserTelemetrySpec *TrinoUserTelemetry - - // Trino worker. - Worker *TrinoWorker -} - -// TrinoTelemetryConfig - Trino user telemetry definition. -type TrinoTelemetryConfig struct { - // Hive Catalog name used to mount external tables on the logs written by trino, if not specified there tables are not created. - HivecatalogName *string - - // Schema of the above catalog to use, to mount query logs as external tables, if not specified tables will be mounted under - // schema trinologs. - HivecatalogSchema *string - - // Retention period for query log table partitions, this doesn't have any affect on actual data. - PartitionRetentionInDays *int32 - - // Azure storage location of the blobs. - Path *string -} - -// TrinoUserPlugin - Trino user plugin. -type TrinoUserPlugin struct { - // Denotes whether the plugin is active or not. - Enabled *bool - - // This field maps to the sub-directory in trino plugins location, that will contain all the plugins under path. - Name *string - - // Fully qualified path to the folder containing the plugins. - Path *string -} - -// TrinoUserPlugins - Trino user plugins spec -type TrinoUserPlugins struct { - // Trino user plugins. - Plugins []*TrinoUserPlugin -} - -// TrinoUserTelemetry - User telemetry -type TrinoUserTelemetry struct { - // Trino user telemetry definition. - Storage *TrinoTelemetryConfig -} - -// TrinoWorker - Trino worker. -type TrinoWorker struct { - // Trino debug configuration. - Debug *TrinoDebugConfig -} - -// UpdatableClusterProfile - Cluster resource patch properties. -type UpdatableClusterProfile struct { - // Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. - AuthorizationProfile *AuthorizationProfile - - // This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. - AutoscaleProfile *AutoscaleProfile - - // Cluster log analytics profile to enable or disable OMS agent for cluster. - LogAnalyticsProfile *ClusterLogAnalyticsProfile - - // Cluster Prometheus profile. - PrometheusProfile *ClusterPrometheusProfile - - // Cluster Ranger plugin profile. - RangerPluginProfile *ClusterRangerPluginProfile - - // The ranger cluster profile. - RangerProfile *RangerProfile - - // Ssh profile for the cluster. - SSHProfile *SSHProfile - - // The script action profile list. - ScriptActionProfiles []*ScriptActionProfile - - // The cluster secret profile. - SecretsProfile *SecretsProfile - - // The service configs profiles. - ServiceConfigsProfiles []*ClusterServiceConfigsProfile - - // Trino Cluster profile. - TrinoProfile *TrinoProfile -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/models_serde.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/models_serde.go deleted file mode 100644 index 4bd94b2304b0..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/models_serde.go +++ /dev/null @@ -1,5682 +0,0 @@ -//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 armhdinsightcontainers - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AksClusterProfileAksClusterAgentPoolIdentityProfile. -func (a AksClusterProfileAksClusterAgentPoolIdentityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "msiClientId", a.MsiClientID) - populate(objectMap, "msiObjectId", a.MsiObjectID) - populate(objectMap, "msiResourceId", a.MsiResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AksClusterProfileAksClusterAgentPoolIdentityProfile. -func (a *AksClusterProfileAksClusterAgentPoolIdentityProfile) 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 "msiClientId": - err = unpopulate(val, "MsiClientID", &a.MsiClientID) - delete(rawMsg, key) - case "msiObjectId": - err = unpopulate(val, "MsiObjectID", &a.MsiObjectID) - delete(rawMsg, key) - case "msiResourceId": - err = unpopulate(val, "MsiResourceID", &a.MsiResourceID) - 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 AuthorizationProfile. -func (a AuthorizationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groupIds", a.GroupIDs) - populate(objectMap, "userIds", a.UserIDs) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProfile. -func (a *AuthorizationProfile) 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 "groupIds": - err = unpopulate(val, "GroupIDs", &a.GroupIDs) - delete(rawMsg, key) - case "userIds": - err = unpopulate(val, "UserIDs", &a.UserIDs) - 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 AutoscaleProfile. -func (a AutoscaleProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoscaleType", a.AutoscaleType) - populate(objectMap, "enabled", a.Enabled) - populate(objectMap, "gracefulDecommissionTimeout", a.GracefulDecommissionTimeout) - populate(objectMap, "loadBasedConfig", a.LoadBasedConfig) - populate(objectMap, "scheduleBasedConfig", a.ScheduleBasedConfig) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleProfile. -func (a *AutoscaleProfile) 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 "autoscaleType": - err = unpopulate(val, "AutoscaleType", &a.AutoscaleType) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &a.Enabled) - delete(rawMsg, key) - case "gracefulDecommissionTimeout": - err = unpopulate(val, "GracefulDecommissionTimeout", &a.GracefulDecommissionTimeout) - delete(rawMsg, key) - case "loadBasedConfig": - err = unpopulate(val, "LoadBasedConfig", &a.LoadBasedConfig) - delete(rawMsg, key) - case "scheduleBasedConfig": - err = unpopulate(val, "ScheduleBasedConfig", &a.ScheduleBasedConfig) - 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 CatalogOptions. -func (c CatalogOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hive", c.Hive) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogOptions. -func (c *CatalogOptions) 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 "hive": - err = unpopulate(val, "Hive", &c.Hive) - 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 Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. -func (c *Cluster) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterAKSPatchVersionUpgradeProperties. -func (c ClusterAKSPatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["upgradeType"] = ClusterUpgradeTypeAKSPatchUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAKSPatchVersionUpgradeProperties. -func (c *ClusterAKSPatchVersionUpgradeProperties) 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 "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterAccessProfile. -func (c ClusterAccessProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enableInternalIngress", c.EnableInternalIngress) - populate(objectMap, "privateLinkServiceId", c.PrivateLinkServiceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAccessProfile. -func (c *ClusterAccessProfile) 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 "enableInternalIngress": - err = unpopulate(val, "EnableInternalIngress", &c.EnableInternalIngress) - delete(rawMsg, key) - case "privateLinkServiceId": - err = unpopulate(val, "PrivateLinkServiceID", &c.PrivateLinkServiceID) - 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 ClusterAksPatchUpgradeHistoryProperties. -func (c ClusterAksPatchUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "newVersion", c.NewVersion) - populate(objectMap, "originalVersion", c.OriginalVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterUpgradeHistoryTypeAKSPatchUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAksPatchUpgradeHistoryProperties. -func (c *ClusterAksPatchUpgradeHistoryProperties) 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 "newVersion": - err = unpopulate(val, "NewVersion", &c.NewVersion) - delete(rawMsg, key) - case "originalVersion": - err = unpopulate(val, "OriginalVersion", &c.OriginalVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterAvailableInPlaceUpgradeProperties. -func (c ClusterAvailableInPlaceUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populateDateTimeRFC3339(objectMap, "createdTime", c.CreatedTime) - populate(objectMap, "description", c.Description) - populate(objectMap, "extendedProperties", c.ExtendedProperties) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - objectMap["upgradeType"] = "ClusterAvailableInPlaceUpgradeProperties" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableInPlaceUpgradeProperties. -func (c *ClusterAvailableInPlaceUpgradeProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &c.CreatedTime) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "extendedProperties": - err = unpopulate(val, "ExtendedProperties", &c.ExtendedProperties) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterAvailableUpgrade. -func (c ClusterAvailableUpgrade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableUpgrade. -func (c *ClusterAvailableUpgrade) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalClusterAvailableUpgradePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterAvailableUpgradeAksPatchUpgradeProperties. -func (c ClusterAvailableUpgradeAksPatchUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentVersion", c.CurrentVersion) - populate(objectMap, "currentVersionStatus", c.CurrentVersionStatus) - populate(objectMap, "latestVersion", c.LatestVersion) - objectMap["upgradeType"] = ClusterAvailableUpgradeTypeAKSPatchUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableUpgradeAksPatchUpgradeProperties. -func (c *ClusterAvailableUpgradeAksPatchUpgradeProperties) 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 "currentVersion": - err = unpopulate(val, "CurrentVersion", &c.CurrentVersion) - delete(rawMsg, key) - case "currentVersionStatus": - err = unpopulate(val, "CurrentVersionStatus", &c.CurrentVersionStatus) - delete(rawMsg, key) - case "latestVersion": - err = unpopulate(val, "LatestVersion", &c.LatestVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterAvailableUpgradeHotfixUpgradeProperties. -func (c ClusterAvailableUpgradeHotfixUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populateDateTimeRFC3339(objectMap, "createdTime", c.CreatedTime) - populate(objectMap, "description", c.Description) - populate(objectMap, "extendedProperties", c.ExtendedProperties) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - objectMap["upgradeType"] = ClusterAvailableUpgradeTypeHotfixUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableUpgradeHotfixUpgradeProperties. -func (c *ClusterAvailableUpgradeHotfixUpgradeProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &c.CreatedTime) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "extendedProperties": - err = unpopulate(val, "ExtendedProperties", &c.ExtendedProperties) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterAvailableUpgradeList. -func (c ClusterAvailableUpgradeList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableUpgradeList. -func (c *ClusterAvailableUpgradeList) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterAvailableUpgradePatchVersionUpgradeProperties. -func (c ClusterAvailableUpgradePatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populateDateTimeRFC3339(objectMap, "createdTime", c.CreatedTime) - populate(objectMap, "description", c.Description) - populate(objectMap, "extendedProperties", c.ExtendedProperties) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - objectMap["upgradeType"] = ClusterAvailableUpgradeTypePatchVersionUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableUpgradePatchVersionUpgradeProperties. -func (c *ClusterAvailableUpgradePatchVersionUpgradeProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &c.CreatedTime) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "extendedProperties": - err = unpopulate(val, "ExtendedProperties", &c.ExtendedProperties) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterAvailableUpgradeProperties. -func (c ClusterAvailableUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["upgradeType"] = c.UpgradeType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterAvailableUpgradeProperties. -func (c *ClusterAvailableUpgradeProperties) 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 "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterComponentsItem. -func (c ClusterComponentsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "version", c.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterComponentsItem. -func (c *ClusterComponentsItem) 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 "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) - 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 ClusterConfigFile. -func (c ClusterConfigFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "content", c.Content) - populate(objectMap, "encoding", c.Encoding) - populate(objectMap, "fileName", c.FileName) - populate(objectMap, "path", c.Path) - populate(objectMap, "values", c.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterConfigFile. -func (c *ClusterConfigFile) 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 "content": - err = unpopulate(val, "Content", &c.Content) - delete(rawMsg, key) - case "encoding": - err = unpopulate(val, "Encoding", &c.Encoding) - delete(rawMsg, key) - case "fileName": - err = unpopulate(val, "FileName", &c.FileName) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &c.Values) - 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 ClusterHotfixUpgradeHistoryProperties. -func (c ClusterHotfixUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterUpgradeHistoryTypeHotfixUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterHotfixUpgradeHistoryProperties. -func (c *ClusterHotfixUpgradeHistoryProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterHotfixUpgradeProperties. -func (c ClusterHotfixUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - objectMap["upgradeType"] = ClusterUpgradeTypeHotfixUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterHotfixUpgradeProperties. -func (c *ClusterHotfixUpgradeProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterHotfixUpgradeRollbackHistoryProperties. -func (c ClusterHotfixUpgradeRollbackHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterUpgradeHistoryTypeHotfixUpgradeRollback - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterHotfixUpgradeRollbackHistoryProperties. -func (c *ClusterHotfixUpgradeRollbackHistoryProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterInPlaceUpgradeHistoryProperties. -func (c ClusterInPlaceUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = "ClusterInPlaceUpgradeHistoryProperties" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInPlaceUpgradeHistoryProperties. -func (c *ClusterInPlaceUpgradeHistoryProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterInPlaceUpgradeProperties. -func (c ClusterInPlaceUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - objectMap["upgradeType"] = "ClusterInPlaceUpgradeProperties" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInPlaceUpgradeProperties. -func (c *ClusterInPlaceUpgradeProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterInstanceViewPropertiesStatus. -func (c ClusterInstanceViewPropertiesStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "message", c.Message) - populate(objectMap, "ready", c.Ready) - populate(objectMap, "reason", c.Reason) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInstanceViewPropertiesStatus. -func (c *ClusterInstanceViewPropertiesStatus) 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 "message": - err = unpopulate(val, "Message", &c.Message) - delete(rawMsg, key) - case "ready": - err = unpopulate(val, "Ready", &c.Ready) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &c.Reason) - 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 ClusterInstanceViewResult. -func (c ClusterInstanceViewResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInstanceViewResult. -func (c *ClusterInstanceViewResult) 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 "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - 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 ClusterInstanceViewResultProperties. -func (c ClusterInstanceViewResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "serviceStatuses", c.ServiceStatuses) - populate(objectMap, "status", c.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInstanceViewResultProperties. -func (c *ClusterInstanceViewResultProperties) 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 "serviceStatuses": - err = unpopulate(val, "ServiceStatuses", &c.ServiceStatuses) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - 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 ClusterInstanceViewsResult. -func (c ClusterInstanceViewsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterInstanceViewsResult. -func (c *ClusterInstanceViewsResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterJob. -func (c ClusterJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterJob. -func (c *ClusterJob) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalClusterJobPropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterJobList. -func (c ClusterJobList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterJobList. -func (c *ClusterJobList) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterJobProperties. -func (c ClusterJobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["jobType"] = c.JobType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterJobProperties. -func (c *ClusterJobProperties) 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 "jobType": - err = unpopulate(val, "JobType", &c.JobType) - 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 ClusterLibrary. -func (c ClusterLibrary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLibrary. -func (c *ClusterLibrary) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalClusterLibraryPropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterLibraryList. -func (c ClusterLibraryList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLibraryList. -func (c *ClusterLibraryList) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterLibraryManagementOperation. -func (c ClusterLibraryManagementOperation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLibraryManagementOperation. -func (c *ClusterLibraryManagementOperation) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterLibraryManagementOperationProperties. -func (c ClusterLibraryManagementOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", c.Action) - populate(objectMap, "libraries", c.Libraries) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLibraryManagementOperationProperties. -func (c *ClusterLibraryManagementOperationProperties) 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 "action": - err = unpopulate(val, "Action", &c.Action) - delete(rawMsg, key) - case "libraries": - err = unpopulate(val, "Libraries", &c.Libraries) - 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 ClusterLibraryProperties. -func (c ClusterLibraryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "message", c.Message) - populate(objectMap, "remarks", c.Remarks) - populate(objectMap, "status", c.Status) - populateDateTimeRFC3339(objectMap, "timestamp", c.Timestamp) - objectMap["type"] = c.Type - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLibraryProperties. -func (c *ClusterLibraryProperties) 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 "message": - err = unpopulate(val, "Message", &c.Message) - delete(rawMsg, key) - case "remarks": - err = unpopulate(val, "Remarks", &c.Remarks) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &c.Timestamp) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterListResult. -func (c ClusterListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. -func (c *ClusterListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterLogAnalyticsApplicationLogs. -func (c ClusterLogAnalyticsApplicationLogs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "stdErrorEnabled", c.StdErrorEnabled) - populate(objectMap, "stdOutEnabled", c.StdOutEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLogAnalyticsApplicationLogs. -func (c *ClusterLogAnalyticsApplicationLogs) 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 "stdErrorEnabled": - err = unpopulate(val, "StdErrorEnabled", &c.StdErrorEnabled) - delete(rawMsg, key) - case "stdOutEnabled": - err = unpopulate(val, "StdOutEnabled", &c.StdOutEnabled) - 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 ClusterLogAnalyticsProfile. -func (c ClusterLogAnalyticsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationLogs", c.ApplicationLogs) - populate(objectMap, "enabled", c.Enabled) - populate(objectMap, "metricsEnabled", c.MetricsEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterLogAnalyticsProfile. -func (c *ClusterLogAnalyticsProfile) 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 "applicationLogs": - err = unpopulate(val, "ApplicationLogs", &c.ApplicationLogs) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &c.Enabled) - delete(rawMsg, key) - case "metricsEnabled": - err = unpopulate(val, "MetricsEnabled", &c.MetricsEnabled) - 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 ClusterPatch. -func (c ClusterPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatch. -func (c *ClusterPatch) 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 "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - 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 ClusterPatchProperties. -func (c ClusterPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clusterProfile", c.ClusterProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatchProperties. -func (c *ClusterPatchProperties) 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 "clusterProfile": - err = unpopulate(val, "ClusterProfile", &c.ClusterProfile) - 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 ClusterPatchVersionUpgradeHistoryProperties. -func (c ClusterPatchVersionUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterUpgradeHistoryTypePatchVersionUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatchVersionUpgradeHistoryProperties. -func (c *ClusterPatchVersionUpgradeHistoryProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPatchVersionUpgradeProperties. -func (c ClusterPatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - objectMap["upgradeType"] = ClusterUpgradeTypePatchVersionUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatchVersionUpgradeProperties. -func (c *ClusterPatchVersionUpgradeProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPatchVersionUpgradeRollbackHistoryProperties. -func (c ClusterPatchVersionUpgradeRollbackHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", c.ComponentName) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "sourceBuildNumber", c.SourceBuildNumber) - populate(objectMap, "sourceClusterVersion", c.SourceClusterVersion) - populate(objectMap, "sourceOssVersion", c.SourceOssVersion) - populate(objectMap, "targetBuildNumber", c.TargetBuildNumber) - populate(objectMap, "targetClusterVersion", c.TargetClusterVersion) - populate(objectMap, "targetOssVersion", c.TargetOssVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterUpgradeHistoryTypePatchVersionUpgradeRollback - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatchVersionUpgradeRollbackHistoryProperties. -func (c *ClusterPatchVersionUpgradeRollbackHistoryProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &c.ComponentName) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) - delete(rawMsg, key) - case "sourceBuildNumber": - err = unpopulate(val, "SourceBuildNumber", &c.SourceBuildNumber) - delete(rawMsg, key) - case "sourceClusterVersion": - err = unpopulate(val, "SourceClusterVersion", &c.SourceClusterVersion) - delete(rawMsg, key) - case "sourceOssVersion": - err = unpopulate(val, "SourceOssVersion", &c.SourceOssVersion) - delete(rawMsg, key) - case "targetBuildNumber": - err = unpopulate(val, "TargetBuildNumber", &c.TargetBuildNumber) - delete(rawMsg, key) - case "targetClusterVersion": - err = unpopulate(val, "TargetClusterVersion", &c.TargetClusterVersion) - delete(rawMsg, key) - case "targetOssVersion": - err = unpopulate(val, "TargetOssVersion", &c.TargetOssVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPool. -func (c ClusterPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPool. -func (c *ClusterPool) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterPoolAKSPatchVersionUpgradeProperties. -func (c ClusterPoolAKSPatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "targetAksVersion", c.TargetAksVersion) - populate(objectMap, "upgradeAllClusterNodes", c.UpgradeAllClusterNodes) - populate(objectMap, "upgradeClusterPool", c.UpgradeClusterPool) - objectMap["upgradeType"] = ClusterPoolUpgradeTypeAKSPatchUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAKSPatchVersionUpgradeProperties. -func (c *ClusterPoolAKSPatchVersionUpgradeProperties) 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 "targetAksVersion": - err = unpopulate(val, "TargetAksVersion", &c.TargetAksVersion) - delete(rawMsg, key) - case "upgradeAllClusterNodes": - err = unpopulate(val, "UpgradeAllClusterNodes", &c.UpgradeAllClusterNodes) - delete(rawMsg, key) - case "upgradeClusterPool": - err = unpopulate(val, "UpgradeClusterPool", &c.UpgradeClusterPool) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolAksPatchUpgradeHistoryProperties. -func (c ClusterPoolAksPatchUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "newVersion", c.NewVersion) - populate(objectMap, "originalVersion", c.OriginalVersion) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeAllClusterNodes", c.UpgradeAllClusterNodes) - populate(objectMap, "upgradeClusterPool", c.UpgradeClusterPool) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAksPatchUpgradeHistoryProperties. -func (c *ClusterPoolAksPatchUpgradeHistoryProperties) 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 "newVersion": - err = unpopulate(val, "NewVersion", &c.NewVersion) - delete(rawMsg, key) - case "originalVersion": - err = unpopulate(val, "OriginalVersion", &c.OriginalVersion) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeAllClusterNodes": - err = unpopulate(val, "UpgradeAllClusterNodes", &c.UpgradeAllClusterNodes) - delete(rawMsg, key) - case "upgradeClusterPool": - err = unpopulate(val, "UpgradeClusterPool", &c.UpgradeClusterPool) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolAvailableUpgrade. -func (c ClusterPoolAvailableUpgrade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAvailableUpgrade. -func (c *ClusterPoolAvailableUpgrade) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalClusterPoolAvailableUpgradePropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterPoolAvailableUpgradeAksPatchUpgradeProperties. -func (c ClusterPoolAvailableUpgradeAksPatchUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "currentVersion", c.CurrentVersion) - populate(objectMap, "currentVersionStatus", c.CurrentVersionStatus) - populate(objectMap, "latestVersion", c.LatestVersion) - objectMap["upgradeType"] = ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAvailableUpgradeAksPatchUpgradeProperties. -func (c *ClusterPoolAvailableUpgradeAksPatchUpgradeProperties) 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 "currentVersion": - err = unpopulate(val, "CurrentVersion", &c.CurrentVersion) - delete(rawMsg, key) - case "currentVersionStatus": - err = unpopulate(val, "CurrentVersionStatus", &c.CurrentVersionStatus) - delete(rawMsg, key) - case "latestVersion": - err = unpopulate(val, "LatestVersion", &c.LatestVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolAvailableUpgradeList. -func (c ClusterPoolAvailableUpgradeList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAvailableUpgradeList. -func (c *ClusterPoolAvailableUpgradeList) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterPoolAvailableUpgradeNodeOsUpgradeProperties. -func (c ClusterPoolAvailableUpgradeNodeOsUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "latestVersion", c.LatestVersion) - objectMap["upgradeType"] = ClusterPoolAvailableUpgradeTypeNodeOsUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAvailableUpgradeNodeOsUpgradeProperties. -func (c *ClusterPoolAvailableUpgradeNodeOsUpgradeProperties) 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 "latestVersion": - err = unpopulate(val, "LatestVersion", &c.LatestVersion) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolAvailableUpgradeProperties. -func (c ClusterPoolAvailableUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["upgradeType"] = c.UpgradeType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolAvailableUpgradeProperties. -func (c *ClusterPoolAvailableUpgradeProperties) 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 "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolListResult. -func (c ClusterPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolListResult. -func (c *ClusterPoolListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterPoolNodeOsImageUpdateProperties. -func (c ClusterPoolNodeOsImageUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["upgradeType"] = ClusterPoolUpgradeTypeNodeOsUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolNodeOsImageUpdateProperties. -func (c *ClusterPoolNodeOsImageUpdateProperties) 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 "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolNodeOsUpgradeHistoryProperties. -func (c ClusterPoolNodeOsUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "newNodeOs", c.NewNodeOs) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = ClusterPoolUpgradeHistoryTypeNodeOsUpgrade - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolNodeOsUpgradeHistoryProperties. -func (c *ClusterPoolNodeOsUpgradeHistoryProperties) 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 "newNodeOs": - err = unpopulate(val, "NewNodeOs", &c.NewNodeOs) - delete(rawMsg, key) - case "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolResourceProperties. -func (c ClusterPoolResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aksClusterProfile", c.AksClusterProfile) - populate(objectMap, "aksManagedResourceGroupName", c.AksManagedResourceGroupName) - populate(objectMap, "clusterPoolProfile", c.ClusterPoolProfile) - populate(objectMap, "computeProfile", c.ComputeProfile) - populate(objectMap, "deploymentId", c.DeploymentID) - populate(objectMap, "logAnalyticsProfile", c.LogAnalyticsProfile) - populate(objectMap, "managedResourceGroupName", c.ManagedResourceGroupName) - populate(objectMap, "networkProfile", c.NetworkProfile) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "status", c.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolResourceProperties. -func (c *ClusterPoolResourceProperties) 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 "aksClusterProfile": - err = unpopulate(val, "AksClusterProfile", &c.AksClusterProfile) - delete(rawMsg, key) - case "aksManagedResourceGroupName": - err = unpopulate(val, "AksManagedResourceGroupName", &c.AksManagedResourceGroupName) - delete(rawMsg, key) - case "clusterPoolProfile": - err = unpopulate(val, "ClusterPoolProfile", &c.ClusterPoolProfile) - delete(rawMsg, key) - case "computeProfile": - err = unpopulate(val, "ComputeProfile", &c.ComputeProfile) - delete(rawMsg, key) - case "deploymentId": - err = unpopulate(val, "DeploymentID", &c.DeploymentID) - delete(rawMsg, key) - case "logAnalyticsProfile": - err = unpopulate(val, "LogAnalyticsProfile", &c.LogAnalyticsProfile) - delete(rawMsg, key) - case "managedResourceGroupName": - err = unpopulate(val, "ManagedResourceGroupName", &c.ManagedResourceGroupName) - delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &c.NetworkProfile) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - 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 ClusterPoolResourcePropertiesAksClusterProfile. -func (c ClusterPoolResourcePropertiesAksClusterProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aksClusterAgentPoolIdentityProfile", c.AksClusterAgentPoolIdentityProfile) - populate(objectMap, "aksClusterResourceId", c.AksClusterResourceID) - populate(objectMap, "aksVersion", c.AksVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolResourcePropertiesAksClusterProfile. -func (c *ClusterPoolResourcePropertiesAksClusterProfile) 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 "aksClusterAgentPoolIdentityProfile": - err = unpopulate(val, "AksClusterAgentPoolIdentityProfile", &c.AksClusterAgentPoolIdentityProfile) - delete(rawMsg, key) - case "aksClusterResourceId": - err = unpopulate(val, "AksClusterResourceID", &c.AksClusterResourceID) - delete(rawMsg, key) - case "aksVersion": - err = unpopulate(val, "AksVersion", &c.AksVersion) - 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 ClusterPoolResourcePropertiesClusterPoolProfile. -func (c ClusterPoolResourcePropertiesClusterPoolProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clusterPoolVersion", c.ClusterPoolVersion) - populate(objectMap, "publicIpTag", c.PublicIPTag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolResourcePropertiesClusterPoolProfile. -func (c *ClusterPoolResourcePropertiesClusterPoolProfile) 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 "clusterPoolVersion": - err = unpopulate(val, "ClusterPoolVersion", &c.ClusterPoolVersion) - delete(rawMsg, key) - case "publicIpTag": - err = unpopulate(val, "PublicIPTag", &c.PublicIPTag) - 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 ClusterPoolResourcePropertiesComputeProfile. -func (c ClusterPoolResourcePropertiesComputeProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "availabilityZones", c.AvailabilityZones) - populate(objectMap, "count", c.Count) - populate(objectMap, "vmSize", c.VMSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolResourcePropertiesComputeProfile. -func (c *ClusterPoolResourcePropertiesComputeProfile) 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 "availabilityZones": - err = unpopulate(val, "AvailabilityZones", &c.AvailabilityZones) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &c.Count) - delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &c.VMSize) - 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 ClusterPoolResourcePropertiesLogAnalyticsProfile. -func (c ClusterPoolResourcePropertiesLogAnalyticsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", c.Enabled) - populate(objectMap, "workspaceId", c.WorkspaceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolResourcePropertiesLogAnalyticsProfile. -func (c *ClusterPoolResourcePropertiesLogAnalyticsProfile) 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 "enabled": - err = unpopulate(val, "Enabled", &c.Enabled) - delete(rawMsg, key) - case "workspaceId": - err = unpopulate(val, "WorkspaceID", &c.WorkspaceID) - 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 ClusterPoolResourcePropertiesNetworkProfile. -func (c ClusterPoolResourcePropertiesNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "apiServerAuthorizedIpRanges", c.APIServerAuthorizedIPRanges) - populate(objectMap, "enablePrivateApiServer", c.EnablePrivateAPIServer) - populate(objectMap, "outboundType", c.OutboundType) - populate(objectMap, "subnetId", c.SubnetID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolResourcePropertiesNetworkProfile. -func (c *ClusterPoolResourcePropertiesNetworkProfile) 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 "apiServerAuthorizedIpRanges": - err = unpopulate(val, "APIServerAuthorizedIPRanges", &c.APIServerAuthorizedIPRanges) - delete(rawMsg, key) - case "enablePrivateApiServer": - err = unpopulate(val, "EnablePrivateAPIServer", &c.EnablePrivateAPIServer) - delete(rawMsg, key) - case "outboundType": - err = unpopulate(val, "OutboundType", &c.OutboundType) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &c.SubnetID) - 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 ClusterPoolUpgrade. -func (c ClusterPoolUpgrade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolUpgrade. -func (c *ClusterPoolUpgrade) 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 "properties": - c.Properties, err = unmarshalClusterPoolUpgradePropertiesClassification(val) - 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 ClusterPoolUpgradeHistory. -func (c ClusterPoolUpgradeHistory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolUpgradeHistory. -func (c *ClusterPoolUpgradeHistory) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalClusterPoolUpgradeHistoryPropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterPoolUpgradeHistoryListResult. -func (c ClusterPoolUpgradeHistoryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolUpgradeHistoryListResult. -func (c *ClusterPoolUpgradeHistoryListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterPoolUpgradeHistoryProperties. -func (c ClusterPoolUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = c.UpgradeType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolUpgradeHistoryProperties. -func (c *ClusterPoolUpgradeHistoryProperties) 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 "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolUpgradeProperties. -func (c ClusterPoolUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["upgradeType"] = c.UpgradeType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolUpgradeProperties. -func (c *ClusterPoolUpgradeProperties) 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 "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterPoolVersion. -func (c ClusterPoolVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolVersion. -func (c *ClusterPoolVersion) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterPoolVersionProperties. -func (c ClusterPoolVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aksVersion", c.AksVersion) - populate(objectMap, "clusterPoolVersion", c.ClusterPoolVersion) - populate(objectMap, "isPreview", c.IsPreview) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolVersionProperties. -func (c *ClusterPoolVersionProperties) 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 "aksVersion": - err = unpopulate(val, "AksVersion", &c.AksVersion) - delete(rawMsg, key) - case "clusterPoolVersion": - err = unpopulate(val, "ClusterPoolVersion", &c.ClusterPoolVersion) - delete(rawMsg, key) - case "isPreview": - err = unpopulate(val, "IsPreview", &c.IsPreview) - 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 ClusterPoolVersionsListResult. -func (c ClusterPoolVersionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPoolVersionsListResult. -func (c *ClusterPoolVersionsListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterProfile. -func (c ClusterProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authorizationProfile", c.AuthorizationProfile) - populate(objectMap, "autoscaleProfile", c.AutoscaleProfile) - populate(objectMap, "clusterAccessProfile", c.ClusterAccessProfile) - populate(objectMap, "clusterVersion", c.ClusterVersion) - populate(objectMap, "components", c.Components) - populate(objectMap, "connectivityProfile", c.ConnectivityProfile) - populate(objectMap, "flinkProfile", c.FlinkProfile) - populate(objectMap, "identityProfile", c.IdentityProfile) - populate(objectMap, "kafkaProfile", c.KafkaProfile) - populate(objectMap, "llapProfile", c.LlapProfile) - populate(objectMap, "logAnalyticsProfile", c.LogAnalyticsProfile) - populate(objectMap, "managedIdentityProfile", c.ManagedIdentityProfile) - populate(objectMap, "ossVersion", c.OssVersion) - populate(objectMap, "prometheusProfile", c.PrometheusProfile) - populate(objectMap, "rangerPluginProfile", c.RangerPluginProfile) - populate(objectMap, "rangerProfile", c.RangerProfile) - populate(objectMap, "sshProfile", c.SSHProfile) - populate(objectMap, "scriptActionProfiles", c.ScriptActionProfiles) - populate(objectMap, "secretsProfile", c.SecretsProfile) - populate(objectMap, "serviceConfigsProfiles", c.ServiceConfigsProfiles) - populate(objectMap, "sparkProfile", c.SparkProfile) - populate(objectMap, "stubProfile", c.StubProfile) - populate(objectMap, "trinoProfile", c.TrinoProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProfile. -func (c *ClusterProfile) 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 "authorizationProfile": - err = unpopulate(val, "AuthorizationProfile", &c.AuthorizationProfile) - delete(rawMsg, key) - case "autoscaleProfile": - err = unpopulate(val, "AutoscaleProfile", &c.AutoscaleProfile) - delete(rawMsg, key) - case "clusterAccessProfile": - err = unpopulate(val, "ClusterAccessProfile", &c.ClusterAccessProfile) - delete(rawMsg, key) - case "clusterVersion": - err = unpopulate(val, "ClusterVersion", &c.ClusterVersion) - delete(rawMsg, key) - case "components": - err = unpopulate(val, "Components", &c.Components) - delete(rawMsg, key) - case "connectivityProfile": - err = unpopulate(val, "ConnectivityProfile", &c.ConnectivityProfile) - delete(rawMsg, key) - case "flinkProfile": - err = unpopulate(val, "FlinkProfile", &c.FlinkProfile) - delete(rawMsg, key) - case "identityProfile": - err = unpopulate(val, "IdentityProfile", &c.IdentityProfile) - delete(rawMsg, key) - case "kafkaProfile": - err = unpopulate(val, "KafkaProfile", &c.KafkaProfile) - delete(rawMsg, key) - case "llapProfile": - err = unpopulate(val, "LlapProfile", &c.LlapProfile) - delete(rawMsg, key) - case "logAnalyticsProfile": - err = unpopulate(val, "LogAnalyticsProfile", &c.LogAnalyticsProfile) - delete(rawMsg, key) - case "managedIdentityProfile": - err = unpopulate(val, "ManagedIdentityProfile", &c.ManagedIdentityProfile) - delete(rawMsg, key) - case "ossVersion": - err = unpopulate(val, "OssVersion", &c.OssVersion) - delete(rawMsg, key) - case "prometheusProfile": - err = unpopulate(val, "PrometheusProfile", &c.PrometheusProfile) - delete(rawMsg, key) - case "rangerPluginProfile": - err = unpopulate(val, "RangerPluginProfile", &c.RangerPluginProfile) - delete(rawMsg, key) - case "rangerProfile": - err = unpopulate(val, "RangerProfile", &c.RangerProfile) - delete(rawMsg, key) - case "sshProfile": - err = unpopulate(val, "SSHProfile", &c.SSHProfile) - delete(rawMsg, key) - case "scriptActionProfiles": - err = unpopulate(val, "ScriptActionProfiles", &c.ScriptActionProfiles) - delete(rawMsg, key) - case "secretsProfile": - err = unpopulate(val, "SecretsProfile", &c.SecretsProfile) - delete(rawMsg, key) - case "serviceConfigsProfiles": - err = unpopulate(val, "ServiceConfigsProfiles", &c.ServiceConfigsProfiles) - delete(rawMsg, key) - case "sparkProfile": - err = unpopulate(val, "SparkProfile", &c.SparkProfile) - delete(rawMsg, key) - case "stubProfile": - err = unpopulate(val, "StubProfile", &c.StubProfile) - delete(rawMsg, key) - case "trinoProfile": - err = unpopulate(val, "TrinoProfile", &c.TrinoProfile) - 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 ClusterPrometheusProfile. -func (c ClusterPrometheusProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", c.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPrometheusProfile. -func (c *ClusterPrometheusProfile) 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 "enabled": - err = unpopulate(val, "Enabled", &c.Enabled) - 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 ClusterRangerPluginProfile. -func (c ClusterRangerPluginProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", c.Enabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterRangerPluginProfile. -func (c *ClusterRangerPluginProfile) 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 "enabled": - err = unpopulate(val, "Enabled", &c.Enabled) - 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 ClusterResizeData. -func (c ClusterResizeData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResizeData. -func (c *ClusterResizeData) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterResizeProperties. -func (c ClusterResizeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "targetWorkerNodeCount", c.TargetWorkerNodeCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResizeProperties. -func (c *ClusterResizeProperties) 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 "targetWorkerNodeCount": - err = unpopulate(val, "TargetWorkerNodeCount", &c.TargetWorkerNodeCount) - 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 ClusterResourceProperties. -func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clusterProfile", c.ClusterProfile) - populate(objectMap, "clusterType", c.ClusterType) - populate(objectMap, "computeProfile", c.ComputeProfile) - populate(objectMap, "deploymentId", c.DeploymentID) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "status", c.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourceProperties. -func (c *ClusterResourceProperties) 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 "clusterProfile": - err = unpopulate(val, "ClusterProfile", &c.ClusterProfile) - delete(rawMsg, key) - case "clusterType": - err = unpopulate(val, "ClusterType", &c.ClusterType) - delete(rawMsg, key) - case "computeProfile": - err = unpopulate(val, "ComputeProfile", &c.ComputeProfile) - delete(rawMsg, key) - case "deploymentId": - err = unpopulate(val, "DeploymentID", &c.DeploymentID) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - 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 ClusterServiceConfig. -func (c ClusterServiceConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "component", c.Component) - populate(objectMap, "files", c.Files) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterServiceConfig. -func (c *ClusterServiceConfig) 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 "component": - err = unpopulate(val, "Component", &c.Component) - delete(rawMsg, key) - case "files": - err = unpopulate(val, "Files", &c.Files) - 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 ClusterServiceConfigsProfile. -func (c ClusterServiceConfigsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configs", c.Configs) - populate(objectMap, "serviceName", c.ServiceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterServiceConfigsProfile. -func (c *ClusterServiceConfigsProfile) 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 "configs": - err = unpopulate(val, "Configs", &c.Configs) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &c.ServiceName) - 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 ClusterUpgrade. -func (c ClusterUpgrade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgrade. -func (c *ClusterUpgrade) 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 "properties": - c.Properties, err = unmarshalClusterUpgradePropertiesClassification(val) - 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 ClusterUpgradeHistory. -func (c ClusterUpgradeHistory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeHistory. -func (c *ClusterUpgradeHistory) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalClusterUpgradeHistoryPropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterUpgradeHistoryListResult. -func (c ClusterUpgradeHistoryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeHistoryListResult. -func (c *ClusterUpgradeHistoryListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ClusterUpgradeHistoryProperties. -func (c ClusterUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "utcTime", c.UTCTime) - populate(objectMap, "upgradeResult", c.UpgradeResult) - objectMap["upgradeType"] = c.UpgradeType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeHistoryProperties. -func (c *ClusterUpgradeHistoryProperties) 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 "utcTime": - err = unpopulate(val, "UTCTime", &c.UTCTime) - delete(rawMsg, key) - case "upgradeResult": - err = unpopulate(val, "UpgradeResult", &c.UpgradeResult) - delete(rawMsg, key) - case "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterUpgradeProperties. -func (c ClusterUpgradeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["upgradeType"] = c.UpgradeType - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeProperties. -func (c *ClusterUpgradeProperties) 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 "upgradeType": - err = unpopulate(val, "UpgradeType", &c.UpgradeType) - 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 ClusterUpgradeRollback. -func (c ClusterUpgradeRollback) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeRollback. -func (c *ClusterUpgradeRollback) 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 "properties": - err = unpopulate(val, "Properties", &c.Properties) - 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 ClusterUpgradeRollbackProperties. -func (c ClusterUpgradeRollbackProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "upgradeHistory", c.UpgradeHistory) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpgradeRollbackProperties. -func (c *ClusterUpgradeRollbackProperties) 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 "upgradeHistory": - err = unpopulate(val, "UpgradeHistory", &c.UpgradeHistory) - 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 ClusterVersion. -func (c ClusterVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterVersion. -func (c *ClusterVersion) 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 "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - 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 ClusterVersionProperties. -func (c ClusterVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clusterPoolVersion", c.ClusterPoolVersion) - populate(objectMap, "clusterType", c.ClusterType) - populate(objectMap, "clusterVersion", c.ClusterVersion) - populate(objectMap, "components", c.Components) - populate(objectMap, "isPreview", c.IsPreview) - populate(objectMap, "ossVersion", c.OssVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterVersionProperties. -func (c *ClusterVersionProperties) 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 "clusterPoolVersion": - err = unpopulate(val, "ClusterPoolVersion", &c.ClusterPoolVersion) - delete(rawMsg, key) - case "clusterType": - err = unpopulate(val, "ClusterType", &c.ClusterType) - delete(rawMsg, key) - case "clusterVersion": - err = unpopulate(val, "ClusterVersion", &c.ClusterVersion) - delete(rawMsg, key) - case "components": - err = unpopulate(val, "Components", &c.Components) - delete(rawMsg, key) - case "isPreview": - err = unpopulate(val, "IsPreview", &c.IsPreview) - delete(rawMsg, key) - case "ossVersion": - err = unpopulate(val, "OssVersion", &c.OssVersion) - 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 ClusterVersionsListResult. -func (c ClusterVersionsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterVersionsListResult. -func (c *ClusterVersionsListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - 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 ComparisonRule. -func (c ComparisonRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "operator", c.Operator) - populate(objectMap, "threshold", c.Threshold) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ComparisonRule. -func (c *ComparisonRule) 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 "operator": - err = unpopulate(val, "Operator", &c.Operator) - delete(rawMsg, key) - case "threshold": - err = unpopulate(val, "Threshold", &c.Threshold) - 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 ComputeProfile. -func (c ComputeProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "availabilityZones", c.AvailabilityZones) - populate(objectMap, "nodes", c.Nodes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeProfile. -func (c *ComputeProfile) 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 "availabilityZones": - err = unpopulate(val, "AvailabilityZones", &c.AvailabilityZones) - delete(rawMsg, key) - case "nodes": - err = unpopulate(val, "Nodes", &c.Nodes) - 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 ComputeResourceDefinition. -func (c ComputeResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cpu", c.CPU) - populate(objectMap, "memory", c.Memory) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeResourceDefinition. -func (c *ComputeResourceDefinition) 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 "cpu": - err = unpopulate(val, "CPU", &c.CPU) - delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &c.Memory) - 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 ConnectivityProfile. -func (c ConnectivityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ssh", c.SSH) - populate(objectMap, "web", c.Web) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityProfile. -func (c *ConnectivityProfile) 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 "ssh": - err = unpopulate(val, "SSH", &c.SSH) - delete(rawMsg, key) - case "web": - err = unpopulate(val, "Web", &c.Web) - 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 ConnectivityProfileWeb. -func (c ConnectivityProfileWeb) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "fqdn", c.Fqdn) - populate(objectMap, "privateFqdn", c.PrivateFqdn) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityProfileWeb. -func (c *ConnectivityProfileWeb) 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 "fqdn": - err = unpopulate(val, "Fqdn", &c.Fqdn) - delete(rawMsg, key) - case "privateFqdn": - err = unpopulate(val, "PrivateFqdn", &c.PrivateFqdn) - 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 DiskStorageProfile. -func (d DiskStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDiskSize", d.DataDiskSize) - populate(objectMap, "dataDiskType", d.DataDiskType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiskStorageProfile. -func (d *DiskStorageProfile) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskSize": - err = unpopulate(val, "DataDiskSize", &d.DataDiskSize) - delete(rawMsg, key) - case "dataDiskType": - err = unpopulate(val, "DataDiskType", &d.DataDiskType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlinkCatalogOptions. -func (f FlinkCatalogOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hive", f.Hive) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlinkCatalogOptions. -func (f *FlinkCatalogOptions) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "hive": - err = unpopulate(val, "Hive", &f.Hive) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlinkHiveCatalogOption. -func (f FlinkHiveCatalogOption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "metastoreDbConnectionAuthenticationMode", f.MetastoreDbConnectionAuthenticationMode) - populate(objectMap, "metastoreDbConnectionPasswordSecret", f.MetastoreDbConnectionPasswordSecret) - populate(objectMap, "metastoreDbConnectionURL", f.MetastoreDbConnectionURL) - populate(objectMap, "metastoreDbConnectionUserName", f.MetastoreDbConnectionUserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlinkHiveCatalogOption. -func (f *FlinkHiveCatalogOption) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "metastoreDbConnectionAuthenticationMode": - err = unpopulate(val, "MetastoreDbConnectionAuthenticationMode", &f.MetastoreDbConnectionAuthenticationMode) - delete(rawMsg, key) - case "metastoreDbConnectionPasswordSecret": - err = unpopulate(val, "MetastoreDbConnectionPasswordSecret", &f.MetastoreDbConnectionPasswordSecret) - delete(rawMsg, key) - case "metastoreDbConnectionURL": - err = unpopulate(val, "MetastoreDbConnectionURL", &f.MetastoreDbConnectionURL) - delete(rawMsg, key) - case "metastoreDbConnectionUserName": - err = unpopulate(val, "MetastoreDbConnectionUserName", &f.MetastoreDbConnectionUserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlinkJobProfile. -func (f FlinkJobProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "args", f.Args) - populate(objectMap, "entryClass", f.EntryClass) - populate(objectMap, "jarName", f.JarName) - populate(objectMap, "jobJarDirectory", f.JobJarDirectory) - populate(objectMap, "savePointName", f.SavePointName) - populate(objectMap, "upgradeMode", f.UpgradeMode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlinkJobProfile. -func (f *FlinkJobProfile) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "args": - err = unpopulate(val, "Args", &f.Args) - delete(rawMsg, key) - case "entryClass": - err = unpopulate(val, "EntryClass", &f.EntryClass) - delete(rawMsg, key) - case "jarName": - err = unpopulate(val, "JarName", &f.JarName) - delete(rawMsg, key) - case "jobJarDirectory": - err = unpopulate(val, "JobJarDirectory", &f.JobJarDirectory) - delete(rawMsg, key) - case "savePointName": - err = unpopulate(val, "SavePointName", &f.SavePointName) - delete(rawMsg, key) - case "upgradeMode": - err = unpopulate(val, "UpgradeMode", &f.UpgradeMode) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlinkJobProperties. -func (f FlinkJobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", f.Action) - populate(objectMap, "actionResult", f.ActionResult) - populate(objectMap, "args", f.Args) - populate(objectMap, "entryClass", f.EntryClass) - populate(objectMap, "flinkConfiguration", f.FlinkConfiguration) - populate(objectMap, "jarName", f.JarName) - populate(objectMap, "jobId", f.JobID) - populate(objectMap, "jobJarDirectory", f.JobJarDirectory) - populate(objectMap, "jobName", f.JobName) - populate(objectMap, "jobOutput", f.JobOutput) - objectMap["jobType"] = JobTypeFlinkJob - populate(objectMap, "lastSavePoint", f.LastSavePoint) - populate(objectMap, "runId", f.RunID) - populate(objectMap, "savePointName", f.SavePointName) - populate(objectMap, "status", f.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlinkJobProperties. -func (f *FlinkJobProperties) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &f.Action) - delete(rawMsg, key) - case "actionResult": - err = unpopulate(val, "ActionResult", &f.ActionResult) - delete(rawMsg, key) - case "args": - err = unpopulate(val, "Args", &f.Args) - delete(rawMsg, key) - case "entryClass": - err = unpopulate(val, "EntryClass", &f.EntryClass) - delete(rawMsg, key) - case "flinkConfiguration": - err = unpopulate(val, "FlinkConfiguration", &f.FlinkConfiguration) - delete(rawMsg, key) - case "jarName": - err = unpopulate(val, "JarName", &f.JarName) - delete(rawMsg, key) - case "jobId": - err = unpopulate(val, "JobID", &f.JobID) - delete(rawMsg, key) - case "jobJarDirectory": - err = unpopulate(val, "JobJarDirectory", &f.JobJarDirectory) - delete(rawMsg, key) - case "jobName": - err = unpopulate(val, "JobName", &f.JobName) - delete(rawMsg, key) - case "jobOutput": - err = unpopulate(val, "JobOutput", &f.JobOutput) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &f.JobType) - delete(rawMsg, key) - case "lastSavePoint": - err = unpopulate(val, "LastSavePoint", &f.LastSavePoint) - delete(rawMsg, key) - case "runId": - err = unpopulate(val, "RunID", &f.RunID) - delete(rawMsg, key) - case "savePointName": - err = unpopulate(val, "SavePointName", &f.SavePointName) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &f.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlinkProfile. -func (f FlinkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "catalogOptions", f.CatalogOptions) - populate(objectMap, "deploymentMode", f.DeploymentMode) - populate(objectMap, "historyServer", f.HistoryServer) - populate(objectMap, "jobManager", f.JobManager) - populate(objectMap, "jobSpec", f.JobSpec) - populate(objectMap, "numReplicas", f.NumReplicas) - populate(objectMap, "storage", f.Storage) - populate(objectMap, "taskManager", f.TaskManager) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlinkProfile. -func (f *FlinkProfile) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "catalogOptions": - err = unpopulate(val, "CatalogOptions", &f.CatalogOptions) - delete(rawMsg, key) - case "deploymentMode": - err = unpopulate(val, "DeploymentMode", &f.DeploymentMode) - delete(rawMsg, key) - case "historyServer": - err = unpopulate(val, "HistoryServer", &f.HistoryServer) - delete(rawMsg, key) - case "jobManager": - err = unpopulate(val, "JobManager", &f.JobManager) - delete(rawMsg, key) - case "jobSpec": - err = unpopulate(val, "JobSpec", &f.JobSpec) - delete(rawMsg, key) - case "numReplicas": - err = unpopulate(val, "NumReplicas", &f.NumReplicas) - delete(rawMsg, key) - case "storage": - err = unpopulate(val, "Storage", &f.Storage) - delete(rawMsg, key) - case "taskManager": - err = unpopulate(val, "TaskManager", &f.TaskManager) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FlinkStorageProfile. -func (f FlinkStorageProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "storageUri", f.StorageURI) - populate(objectMap, "storagekey", f.Storagekey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FlinkStorageProfile. -func (f *FlinkStorageProfile) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "storageUri": - err = unpopulate(val, "StorageURI", &f.StorageURI) - delete(rawMsg, key) - case "storagekey": - err = unpopulate(val, "Storagekey", &f.Storagekey) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HiveCatalogOption. -func (h HiveCatalogOption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "catalogName", h.CatalogName) - populate(objectMap, "metastoreDbConnectionAuthenticationMode", h.MetastoreDbConnectionAuthenticationMode) - populate(objectMap, "metastoreDbConnectionPasswordSecret", h.MetastoreDbConnectionPasswordSecret) - populate(objectMap, "metastoreDbConnectionURL", h.MetastoreDbConnectionURL) - populate(objectMap, "metastoreDbConnectionUserName", h.MetastoreDbConnectionUserName) - populate(objectMap, "metastoreWarehouseDir", h.MetastoreWarehouseDir) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HiveCatalogOption. -func (h *HiveCatalogOption) 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", h, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "catalogName": - err = unpopulate(val, "CatalogName", &h.CatalogName) - delete(rawMsg, key) - case "metastoreDbConnectionAuthenticationMode": - err = unpopulate(val, "MetastoreDbConnectionAuthenticationMode", &h.MetastoreDbConnectionAuthenticationMode) - delete(rawMsg, key) - case "metastoreDbConnectionPasswordSecret": - err = unpopulate(val, "MetastoreDbConnectionPasswordSecret", &h.MetastoreDbConnectionPasswordSecret) - delete(rawMsg, key) - case "metastoreDbConnectionURL": - err = unpopulate(val, "MetastoreDbConnectionURL", &h.MetastoreDbConnectionURL) - delete(rawMsg, key) - case "metastoreDbConnectionUserName": - err = unpopulate(val, "MetastoreDbConnectionUserName", &h.MetastoreDbConnectionUserName) - delete(rawMsg, key) - case "metastoreWarehouseDir": - err = unpopulate(val, "MetastoreWarehouseDir", &h.MetastoreWarehouseDir) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPTag. -func (i IPTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "ipTagType", i.IPTagType) - populate(objectMap, "tag", i.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPTag. -func (i *IPTag) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &i.IPTagType) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &i.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProfile. -func (i IdentityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "msiClientId", i.MsiClientID) - populate(objectMap, "msiObjectId", i.MsiObjectID) - populate(objectMap, "msiResourceId", i.MsiResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProfile. -func (i *IdentityProfile) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "msiClientId": - err = unpopulate(val, "MsiClientID", &i.MsiClientID) - delete(rawMsg, key) - case "msiObjectId": - err = unpopulate(val, "MsiObjectID", &i.MsiObjectID) - delete(rawMsg, key) - case "msiResourceId": - err = unpopulate(val, "MsiResourceID", &i.MsiResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KafkaConnectivityEndpoints. -func (k KafkaConnectivityEndpoints) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "bootstrapServerEndpoint", k.BootstrapServerEndpoint) - populate(objectMap, "brokerEndpoints", k.BrokerEndpoints) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KafkaConnectivityEndpoints. -func (k *KafkaConnectivityEndpoints) 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", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "bootstrapServerEndpoint": - err = unpopulate(val, "BootstrapServerEndpoint", &k.BootstrapServerEndpoint) - delete(rawMsg, key) - case "brokerEndpoints": - err = unpopulate(val, "BrokerEndpoints", &k.BrokerEndpoints) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KafkaProfile. -func (k KafkaProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectivityEndpoints", k.ConnectivityEndpoints) - populate(objectMap, "diskStorage", k.DiskStorage) - populate(objectMap, "enableKRaft", k.EnableKRaft) - populate(objectMap, "enablePublicEndpoints", k.EnablePublicEndpoints) - populate(objectMap, "remoteStorageUri", k.RemoteStorageURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KafkaProfile. -func (k *KafkaProfile) 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", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectivityEndpoints": - err = unpopulate(val, "ConnectivityEndpoints", &k.ConnectivityEndpoints) - delete(rawMsg, key) - case "diskStorage": - err = unpopulate(val, "DiskStorage", &k.DiskStorage) - delete(rawMsg, key) - case "enableKRaft": - err = unpopulate(val, "EnableKRaft", &k.EnableKRaft) - delete(rawMsg, key) - case "enablePublicEndpoints": - err = unpopulate(val, "EnablePublicEndpoints", &k.EnablePublicEndpoints) - delete(rawMsg, key) - case "remoteStorageUri": - err = unpopulate(val, "RemoteStorageURI", &k.RemoteStorageURI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoadBasedConfig. -func (l LoadBasedConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cooldownPeriod", l.CooldownPeriod) - populate(objectMap, "maxNodes", l.MaxNodes) - populate(objectMap, "minNodes", l.MinNodes) - populate(objectMap, "pollInterval", l.PollInterval) - populate(objectMap, "scalingRules", l.ScalingRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBasedConfig. -func (l *LoadBasedConfig) 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", l, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cooldownPeriod": - err = unpopulate(val, "CooldownPeriod", &l.CooldownPeriod) - delete(rawMsg, key) - case "maxNodes": - err = unpopulate(val, "MaxNodes", &l.MaxNodes) - delete(rawMsg, key) - case "minNodes": - err = unpopulate(val, "MinNodes", &l.MinNodes) - delete(rawMsg, key) - case "pollInterval": - err = unpopulate(val, "PollInterval", &l.PollInterval) - delete(rawMsg, key) - case "scalingRules": - err = unpopulate(val, "ScalingRules", &l.ScalingRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedIdentityProfile. -func (m ManagedIdentityProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identityList", m.IdentityList) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentityProfile. -func (m *ManagedIdentityProfile) 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 "identityList": - err = unpopulate(val, "IdentityList", &m.IdentityList) - 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 ManagedIdentitySpec. -func (m ManagedIdentitySpec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", m.ClientID) - populate(objectMap, "objectId", m.ObjectID) - populate(objectMap, "resourceId", m.ResourceID) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIdentitySpec. -func (m *ManagedIdentitySpec) 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 "clientId": - err = unpopulate(val, "ClientID", &m.ClientID) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, "ObjectID", &m.ObjectID) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &m.ResourceID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - 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 MavenLibraryProperties. -func (m MavenLibraryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groupId", m.GroupID) - populate(objectMap, "message", m.Message) - populate(objectMap, "name", m.Name) - populate(objectMap, "remarks", m.Remarks) - populate(objectMap, "status", m.Status) - populateDateTimeRFC3339(objectMap, "timestamp", m.Timestamp) - objectMap["type"] = TypeMaven - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MavenLibraryProperties. -func (m *MavenLibraryProperties) 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 "groupId": - err = unpopulate(val, "GroupID", &m.GroupID) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &m.Message) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "remarks": - err = unpopulate(val, "Remarks", &m.Remarks) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &m.Timestamp) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &m.Version) - 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 NameAvailabilityParameters. -func (n NameAvailabilityParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", n.Name) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityParameters. -func (n *NameAvailabilityParameters) 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 "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) - 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 NameAvailabilityResult. -func (n NameAvailabilityResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "message", n.Message) - populate(objectMap, "nameAvailable", n.NameAvailable) - populate(objectMap, "reason", n.Reason) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailabilityResult. -func (n *NameAvailabilityResult) 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 "message": - err = unpopulate(val, "Message", &n.Message) - delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &n.NameAvailable) - delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &n.Reason) - 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 NodeProfile. -func (n NodeProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "count", n.Count) - populate(objectMap, "type", n.Type) - populate(objectMap, "vmSize", n.VMSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NodeProfile. -func (n *NodeProfile) 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 "count": - err = unpopulate(val, "Count", &n.Count) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) - delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &n.VMSize) - 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 Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "actionType", o.ActionType) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionType": - err = unpopulate(val, "ActionType", &o.ActionType) - delete(rawMsg, key) - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PyPiLibraryProperties. -func (p PyPiLibraryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "message", p.Message) - populate(objectMap, "name", p.Name) - populate(objectMap, "remarks", p.Remarks) - populate(objectMap, "status", p.Status) - populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp) - objectMap["type"] = TypePypi - populate(objectMap, "version", p.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PyPiLibraryProperties. -func (p *PyPiLibraryProperties) 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 "message": - err = unpopulate(val, "Message", &p.Message) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "remarks": - err = unpopulate(val, "Remarks", &p.Remarks) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &p.Version) - 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 RangerAdminSpec. -func (r RangerAdminSpec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "admins", r.Admins) - populate(objectMap, "database", r.Database) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RangerAdminSpec. -func (r *RangerAdminSpec) 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 "admins": - err = unpopulate(val, "Admins", &r.Admins) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &r.Database) - 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 RangerAdminSpecDatabase. -func (r RangerAdminSpecDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "host", r.Host) - populate(objectMap, "name", r.Name) - populate(objectMap, "passwordSecretRef", r.PasswordSecretRef) - populate(objectMap, "username", r.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RangerAdminSpecDatabase. -func (r *RangerAdminSpecDatabase) 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 "host": - err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "passwordSecretRef": - err = unpopulate(val, "PasswordSecretRef", &r.PasswordSecretRef) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &r.Username) - 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 RangerAuditSpec. -func (r RangerAuditSpec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "storageAccount", r.StorageAccount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RangerAuditSpec. -func (r *RangerAuditSpec) 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 "storageAccount": - err = unpopulate(val, "StorageAccount", &r.StorageAccount) - 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 RangerProfile. -func (r RangerProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "rangerAdmin", r.RangerAdmin) - populate(objectMap, "rangerAudit", r.RangerAudit) - populate(objectMap, "rangerUsersync", r.RangerUsersync) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RangerProfile. -func (r *RangerProfile) 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 "rangerAdmin": - err = unpopulate(val, "RangerAdmin", &r.RangerAdmin) - delete(rawMsg, key) - case "rangerAudit": - err = unpopulate(val, "RangerAudit", &r.RangerAudit) - delete(rawMsg, key) - case "rangerUsersync": - err = unpopulate(val, "RangerUsersync", &r.RangerUsersync) - 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 RangerUsersyncSpec. -func (r RangerUsersyncSpec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - populate(objectMap, "groups", r.Groups) - populate(objectMap, "mode", r.Mode) - populate(objectMap, "userMappingLocation", r.UserMappingLocation) - populate(objectMap, "users", r.Users) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RangerUsersyncSpec. -func (r *RangerUsersyncSpec) 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 "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - case "groups": - err = unpopulate(val, "Groups", &r.Groups) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &r.Mode) - delete(rawMsg, key) - case "userMappingLocation": - err = unpopulate(val, "UserMappingLocation", &r.UserMappingLocation) - delete(rawMsg, key) - case "users": - err = unpopulate(val, "Users", &r.Users) - 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 SSHConnectivityEndpoint. -func (s SSHConnectivityEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "endpoint", s.Endpoint) - populate(objectMap, "privateSshEndpoint", s.PrivateSSHEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConnectivityEndpoint. -func (s *SSHConnectivityEndpoint) 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 "endpoint": - err = unpopulate(val, "Endpoint", &s.Endpoint) - delete(rawMsg, key) - case "privateSshEndpoint": - err = unpopulate(val, "PrivateSSHEndpoint", &s.PrivateSSHEndpoint) - 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 SSHProfile. -func (s SSHProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "count", s.Count) - populate(objectMap, "podPrefix", s.PodPrefix) - populate(objectMap, "vmSize", s.VMSize) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SSHProfile. -func (s *SSHProfile) 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 "count": - err = unpopulate(val, "Count", &s.Count) - delete(rawMsg, key) - case "podPrefix": - err = unpopulate(val, "PodPrefix", &s.PodPrefix) - delete(rawMsg, key) - case "vmSize": - err = unpopulate(val, "VMSize", &s.VMSize) - 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 ScalingRule. -func (s ScalingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "actionType", s.ActionType) - populate(objectMap, "comparisonRule", s.ComparisonRule) - populate(objectMap, "evaluationCount", s.EvaluationCount) - populate(objectMap, "scalingMetric", s.ScalingMetric) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingRule. -func (s *ScalingRule) 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 "actionType": - err = unpopulate(val, "ActionType", &s.ActionType) - delete(rawMsg, key) - case "comparisonRule": - err = unpopulate(val, "ComparisonRule", &s.ComparisonRule) - delete(rawMsg, key) - case "evaluationCount": - err = unpopulate(val, "EvaluationCount", &s.EvaluationCount) - delete(rawMsg, key) - case "scalingMetric": - err = unpopulate(val, "ScalingMetric", &s.ScalingMetric) - 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 Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "count", s.Count) - populate(objectMap, "days", s.Days) - populate(objectMap, "endTime", s.EndTime) - populate(objectMap, "startTime", s.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. -func (s *Schedule) 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 "count": - err = unpopulate(val, "Count", &s.Count) - delete(rawMsg, key) - case "days": - err = unpopulate(val, "Days", &s.Days) - delete(rawMsg, key) - case "endTime": - err = unpopulate(val, "EndTime", &s.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &s.StartTime) - 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 ScheduleBasedConfig. -func (s ScheduleBasedConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultCount", s.DefaultCount) - populate(objectMap, "schedules", s.Schedules) - populate(objectMap, "timeZone", s.TimeZone) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleBasedConfig. -func (s *ScheduleBasedConfig) 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 "defaultCount": - err = unpopulate(val, "DefaultCount", &s.DefaultCount) - delete(rawMsg, key) - case "schedules": - err = unpopulate(val, "Schedules", &s.Schedules) - delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &s.TimeZone) - 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 ScriptActionProfile. -func (s ScriptActionProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "parameters", s.Parameters) - populate(objectMap, "services", s.Services) - populate(objectMap, "shouldPersist", s.ShouldPersist) - populate(objectMap, "timeoutInMinutes", s.TimeoutInMinutes) - populate(objectMap, "type", s.Type) - populate(objectMap, "url", s.URL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptActionProfile. -func (s *ScriptActionProfile) 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 "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &s.Parameters) - delete(rawMsg, key) - case "services": - err = unpopulate(val, "Services", &s.Services) - delete(rawMsg, key) - case "shouldPersist": - err = unpopulate(val, "ShouldPersist", &s.ShouldPersist) - delete(rawMsg, key) - case "timeoutInMinutes": - err = unpopulate(val, "TimeoutInMinutes", &s.TimeoutInMinutes) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &s.URL) - 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 SecretReference. -func (s SecretReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyVaultObjectName", s.KeyVaultObjectName) - populate(objectMap, "referenceName", s.ReferenceName) - populate(objectMap, "type", s.Type) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretReference. -func (s *SecretReference) 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 "keyVaultObjectName": - err = unpopulate(val, "KeyVaultObjectName", &s.KeyVaultObjectName) - delete(rawMsg, key) - case "referenceName": - err = unpopulate(val, "ReferenceName", &s.ReferenceName) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) - 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 SecretsProfile. -func (s SecretsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyVaultResourceId", s.KeyVaultResourceID) - populate(objectMap, "secrets", s.Secrets) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretsProfile. -func (s *SecretsProfile) 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 "keyVaultResourceId": - err = unpopulate(val, "KeyVaultResourceID", &s.KeyVaultResourceID) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) - 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 ServiceConfigListResult. -func (s ServiceConfigListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigListResult. -func (s *ServiceConfigListResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - 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 ServiceConfigListResultValueEntity. -func (s ServiceConfigListResultValueEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", s.Description) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigListResultValueEntity. -func (s *ServiceConfigListResultValueEntity) 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 "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - 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 ServiceConfigResult. -func (s ServiceConfigResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigResult. -func (s *ServiceConfigResult) 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 "properties": - err = unpopulate(val, "Properties", &s.Properties) - 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 ServiceConfigResultProperties. -func (s ServiceConfigResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentName", s.ComponentName) - populate(objectMap, "content", s.Content) - populate(objectMap, "customKeys", s.CustomKeys) - populate(objectMap, "defaultKeys", s.DefaultKeys) - populate(objectMap, "fileName", s.FileName) - populate(objectMap, "path", s.Path) - populate(objectMap, "serviceName", s.ServiceName) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceConfigResultProperties. -func (s *ServiceConfigResultProperties) 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 "componentName": - err = unpopulate(val, "ComponentName", &s.ComponentName) - delete(rawMsg, key) - case "content": - err = unpopulate(val, "Content", &s.Content) - delete(rawMsg, key) - case "customKeys": - err = unpopulate(val, "CustomKeys", &s.CustomKeys) - delete(rawMsg, key) - case "defaultKeys": - err = unpopulate(val, "DefaultKeys", &s.DefaultKeys) - delete(rawMsg, key) - case "fileName": - err = unpopulate(val, "FileName", &s.FileName) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &s.Path) - delete(rawMsg, key) - case "serviceName": - err = unpopulate(val, "ServiceName", &s.ServiceName) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - 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 ServiceStatus. -func (s ServiceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "message", s.Message) - populate(objectMap, "ready", s.Ready) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceStatus. -func (s *ServiceStatus) 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 "kind": - err = unpopulate(val, "Kind", &s.Kind) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &s.Message) - delete(rawMsg, key) - case "ready": - err = unpopulate(val, "Ready", &s.Ready) - 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 SparkMetastoreSpec. -func (s SparkMetastoreSpec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dbConnectionAuthenticationMode", s.DbConnectionAuthenticationMode) - populate(objectMap, "dbName", s.DbName) - populate(objectMap, "dbPasswordSecretName", s.DbPasswordSecretName) - populate(objectMap, "dbServerHost", s.DbServerHost) - populate(objectMap, "dbUserName", s.DbUserName) - populate(objectMap, "keyVaultId", s.KeyVaultID) - populate(objectMap, "thriftUrl", s.ThriftURL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SparkMetastoreSpec. -func (s *SparkMetastoreSpec) 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 "dbConnectionAuthenticationMode": - err = unpopulate(val, "DbConnectionAuthenticationMode", &s.DbConnectionAuthenticationMode) - delete(rawMsg, key) - case "dbName": - err = unpopulate(val, "DbName", &s.DbName) - delete(rawMsg, key) - case "dbPasswordSecretName": - err = unpopulate(val, "DbPasswordSecretName", &s.DbPasswordSecretName) - delete(rawMsg, key) - case "dbServerHost": - err = unpopulate(val, "DbServerHost", &s.DbServerHost) - delete(rawMsg, key) - case "dbUserName": - err = unpopulate(val, "DbUserName", &s.DbUserName) - delete(rawMsg, key) - case "keyVaultId": - err = unpopulate(val, "KeyVaultID", &s.KeyVaultID) - delete(rawMsg, key) - case "thriftUrl": - err = unpopulate(val, "ThriftURL", &s.ThriftURL) - 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 SparkProfile. -func (s SparkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultStorageUrl", s.DefaultStorageURL) - populate(objectMap, "metastoreSpec", s.MetastoreSpec) - populate(objectMap, "userPluginsSpec", s.UserPluginsSpec) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SparkProfile. -func (s *SparkProfile) 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 "defaultStorageUrl": - err = unpopulate(val, "DefaultStorageURL", &s.DefaultStorageURL) - delete(rawMsg, key) - case "metastoreSpec": - err = unpopulate(val, "MetastoreSpec", &s.MetastoreSpec) - delete(rawMsg, key) - case "userPluginsSpec": - err = unpopulate(val, "UserPluginsSpec", &s.UserPluginsSpec) - 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 SparkUserPlugin. -func (s SparkUserPlugin) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "path", s.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SparkUserPlugin. -func (s *SparkUserPlugin) 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 "path": - err = unpopulate(val, "Path", &s.Path) - 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 SparkUserPlugins. -func (s SparkUserPlugins) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "plugins", s.Plugins) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SparkUserPlugins. -func (s *SparkUserPlugins) 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 "plugins": - err = unpopulate(val, "Plugins", &s.Plugins) - 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 SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) 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 "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - 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 TagsObject. -func (t TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject. -func (t *TagsObject) 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 "tags": - err = unpopulate(val, "Tags", &t.Tags) - 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 TrinoCoordinator. -func (t TrinoCoordinator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "debug", t.Debug) - populate(objectMap, "highAvailabilityEnabled", t.HighAvailabilityEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoCoordinator. -func (t *TrinoCoordinator) 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 "debug": - err = unpopulate(val, "Debug", &t.Debug) - delete(rawMsg, key) - case "highAvailabilityEnabled": - err = unpopulate(val, "HighAvailabilityEnabled", &t.HighAvailabilityEnabled) - 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 TrinoDebugConfig. -func (t TrinoDebugConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enable", t.Enable) - populate(objectMap, "port", t.Port) - populate(objectMap, "suspend", t.Suspend) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoDebugConfig. -func (t *TrinoDebugConfig) 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 "enable": - err = unpopulate(val, "Enable", &t.Enable) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &t.Port) - delete(rawMsg, key) - case "suspend": - err = unpopulate(val, "Suspend", &t.Suspend) - 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 TrinoProfile. -func (t TrinoProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "catalogOptions", t.CatalogOptions) - populate(objectMap, "coordinator", t.Coordinator) - populate(objectMap, "userPluginsSpec", t.UserPluginsSpec) - populate(objectMap, "userTelemetrySpec", t.UserTelemetrySpec) - populate(objectMap, "worker", t.Worker) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoProfile. -func (t *TrinoProfile) 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 "catalogOptions": - err = unpopulate(val, "CatalogOptions", &t.CatalogOptions) - delete(rawMsg, key) - case "coordinator": - err = unpopulate(val, "Coordinator", &t.Coordinator) - delete(rawMsg, key) - case "userPluginsSpec": - err = unpopulate(val, "UserPluginsSpec", &t.UserPluginsSpec) - delete(rawMsg, key) - case "userTelemetrySpec": - err = unpopulate(val, "UserTelemetrySpec", &t.UserTelemetrySpec) - delete(rawMsg, key) - case "worker": - err = unpopulate(val, "Worker", &t.Worker) - 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 TrinoTelemetryConfig. -func (t TrinoTelemetryConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "hivecatalogName", t.HivecatalogName) - populate(objectMap, "hivecatalogSchema", t.HivecatalogSchema) - populate(objectMap, "partitionRetentionInDays", t.PartitionRetentionInDays) - populate(objectMap, "path", t.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoTelemetryConfig. -func (t *TrinoTelemetryConfig) 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 "hivecatalogName": - err = unpopulate(val, "HivecatalogName", &t.HivecatalogName) - delete(rawMsg, key) - case "hivecatalogSchema": - err = unpopulate(val, "HivecatalogSchema", &t.HivecatalogSchema) - delete(rawMsg, key) - case "partitionRetentionInDays": - err = unpopulate(val, "PartitionRetentionInDays", &t.PartitionRetentionInDays) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &t.Path) - 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 TrinoUserPlugin. -func (t TrinoUserPlugin) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", t.Enabled) - populate(objectMap, "name", t.Name) - populate(objectMap, "path", t.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoUserPlugin. -func (t *TrinoUserPlugin) 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 "enabled": - err = unpopulate(val, "Enabled", &t.Enabled) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &t.Path) - 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 TrinoUserPlugins. -func (t TrinoUserPlugins) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "plugins", t.Plugins) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoUserPlugins. -func (t *TrinoUserPlugins) 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 "plugins": - err = unpopulate(val, "Plugins", &t.Plugins) - 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 TrinoUserTelemetry. -func (t TrinoUserTelemetry) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "storage", t.Storage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoUserTelemetry. -func (t *TrinoUserTelemetry) 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 "storage": - err = unpopulate(val, "Storage", &t.Storage) - 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 TrinoWorker. -func (t TrinoWorker) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "debug", t.Debug) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrinoWorker. -func (t *TrinoWorker) 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 "debug": - err = unpopulate(val, "Debug", &t.Debug) - 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 UpdatableClusterProfile. -func (u UpdatableClusterProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authorizationProfile", u.AuthorizationProfile) - populate(objectMap, "autoscaleProfile", u.AutoscaleProfile) - populate(objectMap, "logAnalyticsProfile", u.LogAnalyticsProfile) - populate(objectMap, "prometheusProfile", u.PrometheusProfile) - populate(objectMap, "rangerPluginProfile", u.RangerPluginProfile) - populate(objectMap, "rangerProfile", u.RangerProfile) - populate(objectMap, "sshProfile", u.SSHProfile) - populate(objectMap, "scriptActionProfiles", u.ScriptActionProfiles) - populate(objectMap, "secretsProfile", u.SecretsProfile) - populate(objectMap, "serviceConfigsProfiles", u.ServiceConfigsProfiles) - populate(objectMap, "trinoProfile", u.TrinoProfile) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdatableClusterProfile. -func (u *UpdatableClusterProfile) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authorizationProfile": - err = unpopulate(val, "AuthorizationProfile", &u.AuthorizationProfile) - delete(rawMsg, key) - case "autoscaleProfile": - err = unpopulate(val, "AutoscaleProfile", &u.AutoscaleProfile) - delete(rawMsg, key) - case "logAnalyticsProfile": - err = unpopulate(val, "LogAnalyticsProfile", &u.LogAnalyticsProfile) - delete(rawMsg, key) - case "prometheusProfile": - err = unpopulate(val, "PrometheusProfile", &u.PrometheusProfile) - delete(rawMsg, key) - case "rangerPluginProfile": - err = unpopulate(val, "RangerPluginProfile", &u.RangerPluginProfile) - delete(rawMsg, key) - case "rangerProfile": - err = unpopulate(val, "RangerProfile", &u.RangerProfile) - delete(rawMsg, key) - case "sshProfile": - err = unpopulate(val, "SSHProfile", &u.SSHProfile) - delete(rawMsg, key) - case "scriptActionProfiles": - err = unpopulate(val, "ScriptActionProfiles", &u.ScriptActionProfiles) - delete(rawMsg, key) - case "secretsProfile": - err = unpopulate(val, "SecretsProfile", &u.SecretsProfile) - delete(rawMsg, key) - case "serviceConfigsProfiles": - err = unpopulate(val, "ServiceConfigsProfiles", &u.ServiceConfigsProfiles) - delete(rawMsg, key) - case "trinoProfile": - err = unpopulate(val, "TrinoProfile", &u.TrinoProfile) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, 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 || string(data) == "null" { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/operations_client.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/operations_client.go deleted file mode 100644 index a901c0b7c1f2..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/operations_client.go +++ /dev/null @@ -1,88 +0,0 @@ -//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 armhdinsightcontainers - -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/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// OperationsClient contains the methods for the Operations group. -// Don't use this type directly, use NewOperationsClient() instead. -type OperationsClient struct { - internal *arm.Client -} - -// NewOperationsClient creates a new instance of OperationsClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &OperationsClient{ - internal: cl, - } - return client, nil -} - -// NewListPager - Returns list of operations. -// -// Generated from API version 2024-05-01-preview -// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ - More: func(page OperationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.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 OperationsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Microsoft.HDInsight/operations" - 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", "2024-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { - return OperationsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/operations_client_example_test.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/operations_client_example_test.go deleted file mode 100644 index 3d7a43552f30..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/operations_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armhdinsightcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0219f9da9de5833fc380f57d6b026f68b5df6f93/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2024-05-01-preview/examples/GetOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsightcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armhdinsightcontainers.OperationListResult{ - // Value: []*armhdinsightcontainers.Operation{ - // { - // Name: to.Ptr("Microsoft.HDInsight/clusterpool/read"), - // Display: &armhdinsightcontainers.OperationDisplay{ - // Description: to.Ptr("Get any cluster pool."), - // Operation: to.Ptr("Get Cluster Pool Operation result."), - // Provider: to.Ptr("HDInsight on AKS"), - // Resource: to.Ptr("Cluster Pool."), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armhdinsightcontainers.Origin("user, system")), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/options.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/options.go deleted file mode 100644 index ca814339157a..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/options.go +++ /dev/null @@ -1,188 +0,0 @@ -//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 armhdinsightcontainers - -// AvailableClusterPoolVersionsClientListByLocationOptions contains the optional parameters for the AvailableClusterPoolVersionsClient.NewListByLocationPager -// method. -type AvailableClusterPoolVersionsClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// AvailableClusterVersionsClientListByLocationOptions contains the optional parameters for the AvailableClusterVersionsClient.NewListByLocationPager -// method. -type AvailableClusterVersionsClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// ClusterAvailableUpgradesClientListOptions contains the optional parameters for the ClusterAvailableUpgradesClient.NewListPager -// method. -type ClusterAvailableUpgradesClientListOptions struct { - // placeholder for future optional parameters -} - -// ClusterJobsClientBeginRunJobOptions contains the optional parameters for the ClusterJobsClient.BeginRunJob method. -type ClusterJobsClientBeginRunJobOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClusterJobsClientListOptions contains the optional parameters for the ClusterJobsClient.NewListPager method. -type ClusterJobsClientListOptions struct { - // The system query option to filter job returned in the response. Allowed value is 'jobName eq {jobName}' or 'jarName eq - // {jarName}'. - Filter *string -} - -// ClusterLibrariesClientBeginManageLibrariesOptions contains the optional parameters for the ClusterLibrariesClient.BeginManageLibraries -// method. -type ClusterLibrariesClientBeginManageLibrariesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClusterLibrariesClientListOptions contains the optional parameters for the ClusterLibrariesClient.NewListPager method. -type ClusterLibrariesClientListOptions struct { - // placeholder for future optional parameters -} - -// ClusterPoolAvailableUpgradesClientListOptions contains the optional parameters for the ClusterPoolAvailableUpgradesClient.NewListPager -// method. -type ClusterPoolAvailableUpgradesClientListOptions struct { - // placeholder for future optional parameters -} - -// ClusterPoolUpgradeHistoriesClientListOptions contains the optional parameters for the ClusterPoolUpgradeHistoriesClient.NewListPager -// method. -type ClusterPoolUpgradeHistoriesClientListOptions struct { - // placeholder for future optional parameters -} - -// ClusterPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClusterPoolsClient.BeginCreateOrUpdate -// method. -type ClusterPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClusterPoolsClientBeginDeleteOptions contains the optional parameters for the ClusterPoolsClient.BeginDelete method. -type ClusterPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClusterPoolsClientBeginUpdateTagsOptions contains the optional parameters for the ClusterPoolsClient.BeginUpdateTags method. -type ClusterPoolsClientBeginUpdateTagsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClusterPoolsClientBeginUpgradeOptions contains the optional parameters for the ClusterPoolsClient.BeginUpgrade method. -type ClusterPoolsClientBeginUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClusterPoolsClientGetOptions contains the optional parameters for the ClusterPoolsClient.Get method. -type ClusterPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClusterPoolsClientListByResourceGroupOptions contains the optional parameters for the ClusterPoolsClient.NewListByResourceGroupPager -// method. -type ClusterPoolsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ClusterPoolsClientListBySubscriptionOptions contains the optional parameters for the ClusterPoolsClient.NewListBySubscriptionPager -// method. -type ClusterPoolsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ClusterUpgradeHistoriesClientListOptions contains the optional parameters for the ClusterUpgradeHistoriesClient.NewListPager -// method. -type ClusterUpgradeHistoriesClientListOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method. -type ClustersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. -type ClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginResizeOptions contains the optional parameters for the ClustersClient.BeginResize method. -type ClustersClientBeginResizeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. -type ClustersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpgradeManualRollbackOptions contains the optional parameters for the ClustersClient.BeginUpgradeManualRollback -// method. -type ClustersClientBeginUpgradeManualRollbackOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpgradeOptions contains the optional parameters for the ClustersClient.BeginUpgrade method. -type ClustersClientBeginUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientGetInstanceViewOptions contains the optional parameters for the ClustersClient.GetInstanceView method. -type ClustersClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. -type ClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListByClusterPoolNameOptions contains the optional parameters for the ClustersClient.NewListByClusterPoolNamePager -// method. -type ClustersClientListByClusterPoolNameOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListInstanceViewsOptions contains the optional parameters for the ClustersClient.NewListInstanceViewsPager -// method. -type ClustersClientListInstanceViewsOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListServiceConfigsOptions contains the optional parameters for the ClustersClient.NewListServiceConfigsPager -// method. -type ClustersClientListServiceConfigsOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability -// method. -type LocationsClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/polymorphic_helpers.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/polymorphic_helpers.go deleted file mode 100644 index 6bc4956d8f7b..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/polymorphic_helpers.go +++ /dev/null @@ -1,209 +0,0 @@ -//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 armhdinsightcontainers - -import "encoding/json" - -func unmarshalClusterAvailableUpgradePropertiesClassification(rawMsg json.RawMessage) (ClusterAvailableUpgradePropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterAvailableUpgradePropertiesClassification - switch m["upgradeType"] { - case "ClusterAvailableInPlaceUpgradeProperties": - b = &ClusterAvailableInPlaceUpgradeProperties{} - case string(ClusterAvailableUpgradeTypeAKSPatchUpgrade): - b = &ClusterAvailableUpgradeAksPatchUpgradeProperties{} - case string(ClusterAvailableUpgradeTypeHotfixUpgrade): - b = &ClusterAvailableUpgradeHotfixUpgradeProperties{} - case string(ClusterAvailableUpgradeTypePatchVersionUpgrade): - b = &ClusterAvailableUpgradePatchVersionUpgradeProperties{} - default: - b = &ClusterAvailableUpgradeProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterJobPropertiesClassification(rawMsg json.RawMessage) (ClusterJobPropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterJobPropertiesClassification - switch m["jobType"] { - case string(JobTypeFlinkJob): - b = &FlinkJobProperties{} - default: - b = &ClusterJobProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterLibraryPropertiesClassification(rawMsg json.RawMessage) (ClusterLibraryPropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterLibraryPropertiesClassification - switch m["type"] { - case string(TypeMaven): - b = &MavenLibraryProperties{} - case string(TypePypi): - b = &PyPiLibraryProperties{} - default: - b = &ClusterLibraryProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterPoolAvailableUpgradePropertiesClassification(rawMsg json.RawMessage) (ClusterPoolAvailableUpgradePropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterPoolAvailableUpgradePropertiesClassification - switch m["upgradeType"] { - case string(ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade): - b = &ClusterPoolAvailableUpgradeAksPatchUpgradeProperties{} - case string(ClusterPoolAvailableUpgradeTypeNodeOsUpgrade): - b = &ClusterPoolAvailableUpgradeNodeOsUpgradeProperties{} - default: - b = &ClusterPoolAvailableUpgradeProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterPoolUpgradeHistoryPropertiesClassification(rawMsg json.RawMessage) (ClusterPoolUpgradeHistoryPropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterPoolUpgradeHistoryPropertiesClassification - switch m["upgradeType"] { - case string(ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade): - b = &ClusterPoolAksPatchUpgradeHistoryProperties{} - case string(ClusterPoolUpgradeHistoryTypeNodeOsUpgrade): - b = &ClusterPoolNodeOsUpgradeHistoryProperties{} - default: - b = &ClusterPoolUpgradeHistoryProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterPoolUpgradePropertiesClassification(rawMsg json.RawMessage) (ClusterPoolUpgradePropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterPoolUpgradePropertiesClassification - switch m["upgradeType"] { - case string(ClusterPoolUpgradeTypeAKSPatchUpgrade): - b = &ClusterPoolAKSPatchVersionUpgradeProperties{} - case string(ClusterPoolUpgradeTypeNodeOsUpgrade): - b = &ClusterPoolNodeOsImageUpdateProperties{} - default: - b = &ClusterPoolUpgradeProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterUpgradeHistoryPropertiesClassification(rawMsg json.RawMessage) (ClusterUpgradeHistoryPropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterUpgradeHistoryPropertiesClassification - switch m["upgradeType"] { - case "ClusterInPlaceUpgradeHistoryProperties": - b = &ClusterInPlaceUpgradeHistoryProperties{} - case string(ClusterUpgradeHistoryTypeAKSPatchUpgrade): - b = &ClusterAksPatchUpgradeHistoryProperties{} - case string(ClusterUpgradeHistoryTypeHotfixUpgrade): - b = &ClusterHotfixUpgradeHistoryProperties{} - case string(ClusterUpgradeHistoryTypeHotfixUpgradeRollback): - b = &ClusterHotfixUpgradeRollbackHistoryProperties{} - case string(ClusterUpgradeHistoryTypePatchVersionUpgrade): - b = &ClusterPatchVersionUpgradeHistoryProperties{} - case string(ClusterUpgradeHistoryTypePatchVersionUpgradeRollback): - b = &ClusterPatchVersionUpgradeRollbackHistoryProperties{} - default: - b = &ClusterUpgradeHistoryProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalClusterUpgradePropertiesClassification(rawMsg json.RawMessage) (ClusterUpgradePropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b ClusterUpgradePropertiesClassification - switch m["upgradeType"] { - case "ClusterInPlaceUpgradeProperties": - b = &ClusterInPlaceUpgradeProperties{} - case string(ClusterUpgradeTypeAKSPatchUpgrade): - b = &ClusterAKSPatchVersionUpgradeProperties{} - case string(ClusterUpgradeTypeHotfixUpgrade): - b = &ClusterHotfixUpgradeProperties{} - case string(ClusterUpgradeTypePatchVersionUpgrade): - b = &ClusterPatchVersionUpgradeProperties{} - default: - b = &ClusterUpgradeProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/responses.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/responses.go deleted file mode 100644 index 2d3ef02c5967..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/responses.go +++ /dev/null @@ -1,186 +0,0 @@ -//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 armhdinsightcontainers - -// AvailableClusterPoolVersionsClientListByLocationResponse contains the response from method AvailableClusterPoolVersionsClient.NewListByLocationPager. -type AvailableClusterPoolVersionsClientListByLocationResponse struct { - // Represents a list of cluster pool versions. - ClusterPoolVersionsListResult -} - -// AvailableClusterVersionsClientListByLocationResponse contains the response from method AvailableClusterVersionsClient.NewListByLocationPager. -type AvailableClusterVersionsClientListByLocationResponse struct { - // Represents a list of cluster versions. - ClusterVersionsListResult -} - -// ClusterAvailableUpgradesClientListResponse contains the response from method ClusterAvailableUpgradesClient.NewListPager. -type ClusterAvailableUpgradesClientListResponse struct { - // Collection of cluster available upgrade. - ClusterAvailableUpgradeList -} - -// ClusterJobsClientListResponse contains the response from method ClusterJobsClient.NewListPager. -type ClusterJobsClientListResponse struct { - // Collection of cluster job. - ClusterJobList -} - -// ClusterJobsClientRunJobResponse contains the response from method ClusterJobsClient.BeginRunJob. -type ClusterJobsClientRunJobResponse struct { - // Cluster job. - ClusterJob -} - -// ClusterLibrariesClientListResponse contains the response from method ClusterLibrariesClient.NewListPager. -type ClusterLibrariesClientListResponse struct { - // Collection of libraries in the cluster. - ClusterLibraryList -} - -// ClusterLibrariesClientManageLibrariesResponse contains the response from method ClusterLibrariesClient.BeginManageLibraries. -type ClusterLibrariesClientManageLibrariesResponse struct { - // placeholder for future response values -} - -// ClusterPoolAvailableUpgradesClientListResponse contains the response from method ClusterPoolAvailableUpgradesClient.NewListPager. -type ClusterPoolAvailableUpgradesClientListResponse struct { - // collection of cluster pool available upgrade. - ClusterPoolAvailableUpgradeList -} - -// ClusterPoolUpgradeHistoriesClientListResponse contains the response from method ClusterPoolUpgradeHistoriesClient.NewListPager. -type ClusterPoolUpgradeHistoriesClientListResponse struct { - // Represents a list of cluster pool upgrade history. - ClusterPoolUpgradeHistoryListResult -} - -// ClusterPoolsClientCreateOrUpdateResponse contains the response from method ClusterPoolsClient.BeginCreateOrUpdate. -type ClusterPoolsClientCreateOrUpdateResponse struct { - // Cluster pool. - ClusterPool -} - -// ClusterPoolsClientDeleteResponse contains the response from method ClusterPoolsClient.BeginDelete. -type ClusterPoolsClientDeleteResponse struct { - // placeholder for future response values -} - -// ClusterPoolsClientGetResponse contains the response from method ClusterPoolsClient.Get. -type ClusterPoolsClientGetResponse struct { - // Cluster pool. - ClusterPool -} - -// ClusterPoolsClientListByResourceGroupResponse contains the response from method ClusterPoolsClient.NewListByResourceGroupPager. -type ClusterPoolsClientListByResourceGroupResponse struct { - // The list cluster pools operation response. - ClusterPoolListResult -} - -// ClusterPoolsClientListBySubscriptionResponse contains the response from method ClusterPoolsClient.NewListBySubscriptionPager. -type ClusterPoolsClientListBySubscriptionResponse struct { - // The list cluster pools operation response. - ClusterPoolListResult -} - -// ClusterPoolsClientUpdateTagsResponse contains the response from method ClusterPoolsClient.BeginUpdateTags. -type ClusterPoolsClientUpdateTagsResponse struct { - // Cluster pool. - ClusterPool -} - -// ClusterPoolsClientUpgradeResponse contains the response from method ClusterPoolsClient.BeginUpgrade. -type ClusterPoolsClientUpgradeResponse struct { - // Cluster pool. - ClusterPool -} - -// ClusterUpgradeHistoriesClientListResponse contains the response from method ClusterUpgradeHistoriesClient.NewListPager. -type ClusterUpgradeHistoriesClientListResponse struct { - // Represents a list of cluster upgrade history. - ClusterUpgradeHistoryListResult -} - -// ClustersClientCreateResponse contains the response from method ClustersClient.BeginCreate. -type ClustersClientCreateResponse struct { - // The cluster. - Cluster -} - -// ClustersClientDeleteResponse contains the response from method ClustersClient.BeginDelete. -type ClustersClientDeleteResponse struct { - // placeholder for future response values -} - -// ClustersClientGetInstanceViewResponse contains the response from method ClustersClient.GetInstanceView. -type ClustersClientGetInstanceViewResponse struct { - // Cluster Instance View. - ClusterInstanceViewResult -} - -// ClustersClientGetResponse contains the response from method ClustersClient.Get. -type ClustersClientGetResponse struct { - // The cluster. - Cluster -} - -// ClustersClientListByClusterPoolNameResponse contains the response from method ClustersClient.NewListByClusterPoolNamePager. -type ClustersClientListByClusterPoolNameResponse struct { - // The list cluster operation response. - ClusterListResult -} - -// ClustersClientListInstanceViewsResponse contains the response from method ClustersClient.NewListInstanceViewsPager. -type ClustersClientListInstanceViewsResponse struct { - // The instance view of a HDInsight Cluster. - ClusterInstanceViewsResult -} - -// ClustersClientListServiceConfigsResponse contains the response from method ClustersClient.NewListServiceConfigsPager. -type ClustersClientListServiceConfigsResponse struct { - // Cluster instance service configs api response. - ServiceConfigListResult -} - -// ClustersClientResizeResponse contains the response from method ClustersClient.BeginResize. -type ClustersClientResizeResponse struct { - // The cluster. - Cluster -} - -// ClustersClientUpdateResponse contains the response from method ClustersClient.BeginUpdate. -type ClustersClientUpdateResponse struct { - // The cluster. - Cluster -} - -// ClustersClientUpgradeManualRollbackResponse contains the response from method ClustersClient.BeginUpgradeManualRollback. -type ClustersClientUpgradeManualRollbackResponse struct { - // The cluster. - Cluster -} - -// ClustersClientUpgradeResponse contains the response from method ClustersClient.BeginUpgrade. -type ClustersClientUpgradeResponse struct { - // The cluster. - Cluster -} - -// LocationsClientCheckNameAvailabilityResponse contains the response from method LocationsClient.CheckNameAvailability. -type LocationsClientCheckNameAvailabilityResponse struct { - // Result of check name availability. - NameAvailabilityResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. -type OperationsClientListResponse struct { - // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - OperationListResult -} diff --git a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/time_rfc3339.go b/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/time_rfc3339.go deleted file mode 100644 index b9dac4761a7b..000000000000 --- a/sdk/resourcemanager/hdinsightcontainers/armhdinsightcontainers/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//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 armhdinsightcontainers - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -}