From 42dec7e4ffab4445f992025a8a989a621db59280 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 13:50:52 +0800 Subject: [PATCH 1/8] Generated from specification/containerinstance/resource-manager/readme.md tag package-2021-10 (commit hash: 61218420e95ad3435a029144877b110b56418958) --- .../containerinstanceapi/models.go | 2 +- .../mgmt/containerinstance/models.go | 15 +- .../containerinstanceapi/models.go | 2 +- .../mgmt/containerinstance/models.go | 15 +- .../2021-10-01/containerinstance/CHANGELOG.md | 2 + .../2021-10-01/containerinstance/_meta.json | 11 + .../2021-10-01/containerinstance/client.go | 41 + .../containerinstance/containergroups.go | 919 ++++++++ .../containerinstanceapi/interfaces.go | 59 + .../containerinstance/containers.go | 280 +++ .../2021-10-01/containerinstance/enums.go | 201 ++ .../2021-10-01/containerinstance/location.go | 337 +++ .../2021-10-01/containerinstance/models.go | 1849 +++++++++++++++++ .../containerinstance/operations.go | 140 ++ .../2021-10-01/containerinstance/version.go | 19 + 15 files changed, 3888 insertions(+), 4 deletions(-) create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/CHANGELOG.md create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/_meta.json create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/client.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/containergroups.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/containerinstanceapi/interfaces.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/containers.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/enums.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/location.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/models.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/operations.go create mode 100644 services/containerinstance/mgmt/2021-10-01/containerinstance/version.go diff --git a/profiles/latest/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go b/profiles/latest/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go index 6d2812f7ea4c..a1cbe027968f 100644 --- a/profiles/latest/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go +++ b/profiles/latest/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go @@ -9,7 +9,7 @@ package containerinstanceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-09-01/containerinstance/containerinstanceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance/containerinstanceapi" type ContainerGroupsClientAPI = original.ContainerGroupsClientAPI type ContainersClientAPI = original.ContainersClientAPI diff --git a/profiles/latest/containerinstance/mgmt/containerinstance/models.go b/profiles/latest/containerinstance/mgmt/containerinstance/models.go index 672d72fa345f..818c73596213 100644 --- a/profiles/latest/containerinstance/mgmt/containerinstance/models.go +++ b/profiles/latest/containerinstance/mgmt/containerinstance/models.go @@ -12,13 +12,23 @@ package containerinstance import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-09-01/containerinstance" + original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScope + +const ( + AutoGeneratedDomainNameLabelScopeNoreuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeNoreuse + AutoGeneratedDomainNameLabelScopeResourceGroupReuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeResourceGroupReuse + AutoGeneratedDomainNameLabelScopeSubscriptionReuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeSubscriptionReuse + AutoGeneratedDomainNameLabelScopeTenantReuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeTenantReuse + AutoGeneratedDomainNameLabelScopeUnsecure AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeUnsecure +) + type ContainerGroupIPAddressType = original.ContainerGroupIPAddressType const ( @@ -228,6 +238,9 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAutoGeneratedDomainNameLabelScopeValues() []AutoGeneratedDomainNameLabelScope { + return original.PossibleAutoGeneratedDomainNameLabelScopeValues() +} func PossibleContainerGroupIPAddressTypeValues() []ContainerGroupIPAddressType { return original.PossibleContainerGroupIPAddressTypeValues() } diff --git a/profiles/preview/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go b/profiles/preview/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go index 6d2812f7ea4c..a1cbe027968f 100644 --- a/profiles/preview/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go +++ b/profiles/preview/containerinstance/mgmt/containerinstance/containerinstanceapi/models.go @@ -9,7 +9,7 @@ package containerinstanceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-09-01/containerinstance/containerinstanceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance/containerinstanceapi" type ContainerGroupsClientAPI = original.ContainerGroupsClientAPI type ContainersClientAPI = original.ContainersClientAPI diff --git a/profiles/preview/containerinstance/mgmt/containerinstance/models.go b/profiles/preview/containerinstance/mgmt/containerinstance/models.go index 768b554b49ec..b9f61150aab9 100644 --- a/profiles/preview/containerinstance/mgmt/containerinstance/models.go +++ b/profiles/preview/containerinstance/mgmt/containerinstance/models.go @@ -12,13 +12,23 @@ package containerinstance import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-09-01/containerinstance" + original "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScope + +const ( + AutoGeneratedDomainNameLabelScopeNoreuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeNoreuse + AutoGeneratedDomainNameLabelScopeResourceGroupReuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeResourceGroupReuse + AutoGeneratedDomainNameLabelScopeSubscriptionReuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeSubscriptionReuse + AutoGeneratedDomainNameLabelScopeTenantReuse AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeTenantReuse + AutoGeneratedDomainNameLabelScopeUnsecure AutoGeneratedDomainNameLabelScope = original.AutoGeneratedDomainNameLabelScopeUnsecure +) + type ContainerGroupIPAddressType = original.ContainerGroupIPAddressType const ( @@ -228,6 +238,9 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAutoGeneratedDomainNameLabelScopeValues() []AutoGeneratedDomainNameLabelScope { + return original.PossibleAutoGeneratedDomainNameLabelScopeValues() +} func PossibleContainerGroupIPAddressTypeValues() []ContainerGroupIPAddressType { return original.PossibleContainerGroupIPAddressTypeValues() } diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/CHANGELOG.md b/services/containerinstance/mgmt/2021-10-01/containerinstance/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/_meta.json b/services/containerinstance/mgmt/2021-10-01/containerinstance/_meta.json new file mode 100644 index 000000000000..a4f828734531 --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "61218420e95ad3435a029144877b110b56418958", + "readme": "/_/azure-rest-api-specs/specification/containerinstance/resource-manager/readme.md", + "tag": "package-2021-10", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-10 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/containerinstance/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/client.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/client.go new file mode 100644 index 000000000000..a63f82065f3c --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/client.go @@ -0,0 +1,41 @@ +// Package containerinstance implements the Azure ARM Containerinstance service API version 2021-10-01. +// +// +package containerinstance + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerinstance + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerinstance. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/containergroups.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/containergroups.go new file mode 100644 index 000000000000..caedb4973a66 --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/containergroups.go @@ -0,0 +1,919 @@ +package containerinstance + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ContainerGroupsClient is the client for the ContainerGroups methods of the Containerinstance service. +type ContainerGroupsClient struct { + BaseClient +} + +// NewContainerGroupsClient creates an instance of the ContainerGroupsClient client. +func NewContainerGroupsClient(subscriptionID string) ContainerGroupsClient { + return NewContainerGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerGroupsClientWithBaseURI creates an instance of the ContainerGroupsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewContainerGroupsClientWithBaseURI(baseURI string, subscriptionID string) ContainerGroupsClient { + return ContainerGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update container groups with specified configurations. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +// containerGroup - the properties of the container group to be created or updated. +func (client ContainerGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup ContainerGroup) (result ContainerGroupsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: containerGroup, + Constraints: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.Containers", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "containerGroup.ContainerGroupProperties.IPAddress", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.IPAddress.Ports", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "containerGroup.ContainerGroupProperties.Diagnostics", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.Diagnostics.LogAnalytics", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.Diagnostics.LogAnalytics.WorkspaceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "containerGroup.ContainerGroupProperties.Diagnostics.LogAnalytics.WorkspaceKey", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "containerGroup.ContainerGroupProperties.DNSConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.DNSConfig.NameServers", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "containerGroup.ContainerGroupProperties.EncryptionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "containerGroup.ContainerGroupProperties.EncryptionProperties.VaultBaseURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "containerGroup.ContainerGroupProperties.EncryptionProperties.KeyName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "containerGroup.ContainerGroupProperties.EncryptionProperties.KeyVersion", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerinstance.ContainerGroupsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerGroupName, containerGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup ContainerGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", pathParameters), + autorest.WithJSON(containerGroup), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) CreateOrUpdateSender(req *http.Request) (future ContainerGroupsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified container group in the specified subscription and resource group. The operation does not +// delete other resources provided by the user, such as volumes. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +func (client ContainerGroupsClient) Delete(ctx context.Context, resourceGroupName string, containerGroupName string) (result ContainerGroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, containerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainerGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) DeleteSender(req *http.Request) (future ContainerGroupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) DeleteResponder(resp *http.Response) (result ContainerGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the properties of the specified container group in the specified subscription and resource group. The +// operation returns the properties of each container group including containers, image registry credentials, restart +// policy, IP address type, OS type, state, and volumes. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +func (client ContainerGroupsClient) Get(ctx context.Context, resourceGroupName string, containerGroupName string) (result ContainerGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, containerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, containerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) GetResponder(resp *http.Response) (result ContainerGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOutboundNetworkDependenciesEndpoints gets all the network dependencies for this container group to allow complete +// control of network setting and configuration. For container groups, this will always be an empty list. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +func (client ContainerGroupsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, containerGroupName string) (result ListString, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.GetOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, containerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "GetOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + + return +} + +// GetOutboundNetworkDependenciesEndpointsPreparer prepares the GetOutboundNetworkDependenciesEndpoints request. +func (client ContainerGroupsClient) GetOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, containerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutboundNetworkDependenciesEndpointsSender sends the GetOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) GetOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOutboundNetworkDependenciesEndpointsResponder handles the response to the GetOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListString, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get a list of container groups in the specified subscription. This operation returns properties of each +// container group including containers, image registry credentials, restart policy, IP address type, OS type, state, +// and volumes. +func (client ContainerGroupsClient) List(ctx context.Context) (result ContainerGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.List") + defer func() { + sc := -1 + if result.cglr.Response.Response != nil { + sc = result.cglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "List", resp, "Failure sending request") + return + } + + result.cglr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "List", resp, "Failure responding to request") + return + } + if result.cglr.hasNextLink() && result.cglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ContainerGroupsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) ListResponder(resp *http.Response) (result ContainerGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ContainerGroupsClient) listNextResults(ctx context.Context, lastResults ContainerGroupListResult) (result ContainerGroupListResult, err error) { + req, err := lastResults.containerGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerGroupsClient) ListComplete(ctx context.Context) (result ContainerGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup get a list of container groups in a specified subscription and resource group. This operation +// returns properties of each container group including containers, image registry credentials, restart policy, IP +// address type, OS type, state, and volumes. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ContainerGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ContainerGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cglr.Response.Response != nil { + sc = result.cglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cglr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cglr.hasNextLink() && result.cglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ContainerGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ContainerGroupListResult) (result ContainerGroupListResult, err error) { + req, err := lastResults.containerGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ContainerGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Restart restarts all containers in a container group in place. If container image has updates, new image will be +// downloaded. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +func (client ContainerGroupsClient) Restart(ctx context.Context, resourceGroupName string, containerGroupName string) (result ContainerGroupsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, containerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client ContainerGroupsClient) RestartPreparer(ctx context.Context, resourceGroupName string, containerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) RestartSender(req *http.Request) (future ContainerGroupsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts all containers in a container group. Compute resources will be allocated and billing will start. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +func (client ContainerGroupsClient) Start(ctx context.Context, resourceGroupName string, containerGroupName string) (result ContainerGroupsStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, containerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client ContainerGroupsClient) StartPreparer(ctx context.Context, resourceGroupName string, containerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) StartSender(req *http.Request) (future ContainerGroupsStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stops all containers in a container group. Compute resources will be deallocated and billing will stop. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +func (client ContainerGroupsClient) Stop(ctx context.Context, resourceGroupName string, containerGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Stop") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StopPreparer(ctx, resourceGroupName, containerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Stop", resp, "Failure responding to request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client ContainerGroupsClient) StopPreparer(ctx context.Context, resourceGroupName string, containerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) StopSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates container group tags with specified values. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +// resource - the container group resource with just the tags to be updated. +func (client ContainerGroupsClient) Update(ctx context.Context, resourceGroupName string, containerGroupName string, resource Resource) (result ContainerGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, containerGroupName, resource) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ContainerGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, containerGroupName string, resource Resource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + resource.ID = nil + resource.Name = nil + resource.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", pathParameters), + autorest.WithJSON(resource), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ContainerGroupsClient) UpdateResponder(resp *http.Response) (result ContainerGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/containerinstanceapi/interfaces.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/containerinstanceapi/interfaces.go new file mode 100644 index 000000000000..b3d33404e67f --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/containerinstanceapi/interfaces.go @@ -0,0 +1,59 @@ +package containerinstanceapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance" + "github.com/Azure/go-autorest/autorest" +) + +// ContainerGroupsClientAPI contains the set of methods on the ContainerGroupsClient type. +type ContainerGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, containerGroupName string, containerGroup containerinstance.ContainerGroup) (result containerinstance.ContainerGroupsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, containerGroupName string) (result containerinstance.ContainerGroupsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, containerGroupName string) (result containerinstance.ContainerGroup, err error) + GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, containerGroupName string) (result containerinstance.ListString, err error) + List(ctx context.Context) (result containerinstance.ContainerGroupListResultPage, err error) + ListComplete(ctx context.Context) (result containerinstance.ContainerGroupListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerinstance.ContainerGroupListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerinstance.ContainerGroupListResultIterator, err error) + Restart(ctx context.Context, resourceGroupName string, containerGroupName string) (result containerinstance.ContainerGroupsRestartFuture, err error) + Start(ctx context.Context, resourceGroupName string, containerGroupName string) (result containerinstance.ContainerGroupsStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, containerGroupName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, containerGroupName string, resource containerinstance.Resource) (result containerinstance.ContainerGroup, err error) +} + +var _ ContainerGroupsClientAPI = (*containerinstance.ContainerGroupsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerinstance.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result containerinstance.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*containerinstance.OperationsClient)(nil) + +// LocationClientAPI contains the set of methods on the LocationClient type. +type LocationClientAPI interface { + ListCachedImages(ctx context.Context, location string) (result containerinstance.CachedImagesListResultPage, err error) + ListCachedImagesComplete(ctx context.Context, location string) (result containerinstance.CachedImagesListResultIterator, err error) + ListCapabilities(ctx context.Context, location string) (result containerinstance.CapabilitiesListResultPage, err error) + ListCapabilitiesComplete(ctx context.Context, location string) (result containerinstance.CapabilitiesListResultIterator, err error) + ListUsage(ctx context.Context, location string) (result containerinstance.UsageListResult, err error) +} + +var _ LocationClientAPI = (*containerinstance.LocationClient)(nil) + +// ContainersClientAPI contains the set of methods on the ContainersClient type. +type ContainersClientAPI interface { + Attach(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string) (result containerinstance.ContainerAttachResponse, err error) + ExecuteCommand(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest containerinstance.ContainerExecRequest) (result containerinstance.ContainerExecResponse, err error) + ListLogs(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32, timestamps *bool) (result containerinstance.Logs, err error) +} + +var _ ContainersClientAPI = (*containerinstance.ContainersClient)(nil) diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/containers.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/containers.go new file mode 100644 index 000000000000..cfa377c0490c --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/containers.go @@ -0,0 +1,280 @@ +package containerinstance + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ContainersClient is the client for the Containers methods of the Containerinstance service. +type ContainersClient struct { + BaseClient +} + +// NewContainersClient creates an instance of the ContainersClient client. +func NewContainersClient(subscriptionID string) ContainersClient { + return NewContainersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainersClientWithBaseURI creates an instance of the ContainersClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewContainersClientWithBaseURI(baseURI string, subscriptionID string) ContainersClient { + return ContainersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Attach attach to the output stream of a specific container instance in a specified resource group and container +// group. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +// containerName - the name of the container instance. +func (client ContainersClient) Attach(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string) (result ContainerAttachResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.Attach") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AttachPreparer(ctx, resourceGroupName, containerGroupName, containerName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "Attach", nil, "Failure preparing request") + return + } + + resp, err := client.AttachSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "Attach", resp, "Failure sending request") + return + } + + result, err = client.AttachResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "Attach", resp, "Failure responding to request") + return + } + + return +} + +// AttachPreparer prepares the Attach request. +func (client ContainersClient) AttachPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "containerName": autorest.Encode("path", containerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AttachSender sends the Attach request. The method will close the +// http.Response Body if it receives an error. +func (client ContainersClient) AttachSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AttachResponder handles the response to the Attach request. The method always +// closes the http.Response Body. +func (client ContainersClient) AttachResponder(resp *http.Response) (result ContainerAttachResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ExecuteCommand executes a command for a specific container instance in a specified resource group and container +// group. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +// containerName - the name of the container instance. +// containerExecRequest - the request for the exec command. +func (client ContainersClient) ExecuteCommand(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (result ContainerExecResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.ExecuteCommand") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExecuteCommandPreparer(ctx, resourceGroupName, containerGroupName, containerName, containerExecRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ExecuteCommand", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteCommandSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ExecuteCommand", resp, "Failure sending request") + return + } + + result, err = client.ExecuteCommandResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ExecuteCommand", resp, "Failure responding to request") + return + } + + return +} + +// ExecuteCommandPreparer prepares the ExecuteCommand request. +func (client ContainersClient) ExecuteCommandPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, containerExecRequest ContainerExecRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "containerName": autorest.Encode("path", containerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec", pathParameters), + autorest.WithJSON(containerExecRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteCommandSender sends the ExecuteCommand request. The method will close the +// http.Response Body if it receives an error. +func (client ContainersClient) ExecuteCommandSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExecuteCommandResponder handles the response to the ExecuteCommand request. The method always +// closes the http.Response Body. +func (client ContainersClient) ExecuteCommandResponder(resp *http.Response) (result ContainerExecResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListLogs get the logs for a specified container instance in a specified resource group and container group. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerGroupName - the name of the container group. +// containerName - the name of the container instance. +// tail - the number of lines to show from the tail of the container instance log. If not provided, all +// available logs are shown up to 4mb. +// timestamps - if true, adds a timestamp at the beginning of every line of log output. If not provided, +// defaults to false. +func (client ContainersClient) ListLogs(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32, timestamps *bool) (result Logs, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainersClient.ListLogs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListLogsPreparer(ctx, resourceGroupName, containerGroupName, containerName, tail, timestamps) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ListLogs", nil, "Failure preparing request") + return + } + + resp, err := client.ListLogsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ListLogs", resp, "Failure sending request") + return + } + + result, err = client.ListLogsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainersClient", "ListLogs", resp, "Failure responding to request") + return + } + + return +} + +// ListLogsPreparer prepares the ListLogs request. +func (client ContainersClient) ListLogsPreparer(ctx context.Context, resourceGroupName string, containerGroupName string, containerName string, tail *int32, timestamps *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerGroupName": autorest.Encode("path", containerGroupName), + "containerName": autorest.Encode("path", containerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if tail != nil { + queryParameters["tail"] = autorest.Encode("query", *tail) + } + if timestamps != nil { + queryParameters["timestamps"] = autorest.Encode("query", *timestamps) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListLogsSender sends the ListLogs request. The method will close the +// http.Response Body if it receives an error. +func (client ContainersClient) ListLogsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListLogsResponder handles the response to the ListLogs request. The method always +// closes the http.Response Body. +func (client ContainersClient) ListLogsResponder(resp *http.Response) (result Logs, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/enums.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/enums.go new file mode 100644 index 000000000000..498e6bc73c17 --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/enums.go @@ -0,0 +1,201 @@ +package containerinstance + +// 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. + +// AutoGeneratedDomainNameLabelScope enumerates the values for auto generated domain name label scope. +type AutoGeneratedDomainNameLabelScope string + +const ( + // AutoGeneratedDomainNameLabelScopeNoreuse ... + AutoGeneratedDomainNameLabelScopeNoreuse AutoGeneratedDomainNameLabelScope = "Noreuse" + // AutoGeneratedDomainNameLabelScopeResourceGroupReuse ... + AutoGeneratedDomainNameLabelScopeResourceGroupReuse AutoGeneratedDomainNameLabelScope = "ResourceGroupReuse" + // AutoGeneratedDomainNameLabelScopeSubscriptionReuse ... + AutoGeneratedDomainNameLabelScopeSubscriptionReuse AutoGeneratedDomainNameLabelScope = "SubscriptionReuse" + // AutoGeneratedDomainNameLabelScopeTenantReuse ... + AutoGeneratedDomainNameLabelScopeTenantReuse AutoGeneratedDomainNameLabelScope = "TenantReuse" + // AutoGeneratedDomainNameLabelScopeUnsecure ... + AutoGeneratedDomainNameLabelScopeUnsecure AutoGeneratedDomainNameLabelScope = "Unsecure" +) + +// PossibleAutoGeneratedDomainNameLabelScopeValues returns an array of possible values for the AutoGeneratedDomainNameLabelScope const type. +func PossibleAutoGeneratedDomainNameLabelScopeValues() []AutoGeneratedDomainNameLabelScope { + return []AutoGeneratedDomainNameLabelScope{AutoGeneratedDomainNameLabelScopeNoreuse, AutoGeneratedDomainNameLabelScopeResourceGroupReuse, AutoGeneratedDomainNameLabelScopeSubscriptionReuse, AutoGeneratedDomainNameLabelScopeTenantReuse, AutoGeneratedDomainNameLabelScopeUnsecure} +} + +// ContainerGroupIPAddressType enumerates the values for container group ip address type. +type ContainerGroupIPAddressType string + +const ( + // ContainerGroupIPAddressTypePrivate ... + ContainerGroupIPAddressTypePrivate ContainerGroupIPAddressType = "Private" + // ContainerGroupIPAddressTypePublic ... + ContainerGroupIPAddressTypePublic ContainerGroupIPAddressType = "Public" +) + +// PossibleContainerGroupIPAddressTypeValues returns an array of possible values for the ContainerGroupIPAddressType const type. +func PossibleContainerGroupIPAddressTypeValues() []ContainerGroupIPAddressType { + return []ContainerGroupIPAddressType{ContainerGroupIPAddressTypePrivate, ContainerGroupIPAddressTypePublic} +} + +// ContainerGroupNetworkProtocol enumerates the values for container group network protocol. +type ContainerGroupNetworkProtocol string + +const ( + // ContainerGroupNetworkProtocolTCP ... + ContainerGroupNetworkProtocolTCP ContainerGroupNetworkProtocol = "TCP" + // ContainerGroupNetworkProtocolUDP ... + ContainerGroupNetworkProtocolUDP ContainerGroupNetworkProtocol = "UDP" +) + +// PossibleContainerGroupNetworkProtocolValues returns an array of possible values for the ContainerGroupNetworkProtocol const type. +func PossibleContainerGroupNetworkProtocolValues() []ContainerGroupNetworkProtocol { + return []ContainerGroupNetworkProtocol{ContainerGroupNetworkProtocolTCP, ContainerGroupNetworkProtocolUDP} +} + +// ContainerGroupRestartPolicy enumerates the values for container group restart policy. +type ContainerGroupRestartPolicy string + +const ( + // ContainerGroupRestartPolicyAlways ... + ContainerGroupRestartPolicyAlways ContainerGroupRestartPolicy = "Always" + // ContainerGroupRestartPolicyNever ... + ContainerGroupRestartPolicyNever ContainerGroupRestartPolicy = "Never" + // ContainerGroupRestartPolicyOnFailure ... + ContainerGroupRestartPolicyOnFailure ContainerGroupRestartPolicy = "OnFailure" +) + +// PossibleContainerGroupRestartPolicyValues returns an array of possible values for the ContainerGroupRestartPolicy const type. +func PossibleContainerGroupRestartPolicyValues() []ContainerGroupRestartPolicy { + return []ContainerGroupRestartPolicy{ContainerGroupRestartPolicyAlways, ContainerGroupRestartPolicyNever, ContainerGroupRestartPolicyOnFailure} +} + +// ContainerGroupSku enumerates the values for container group sku. +type ContainerGroupSku string + +const ( + // ContainerGroupSkuDedicated ... + ContainerGroupSkuDedicated ContainerGroupSku = "Dedicated" + // ContainerGroupSkuStandard ... + ContainerGroupSkuStandard ContainerGroupSku = "Standard" +) + +// PossibleContainerGroupSkuValues returns an array of possible values for the ContainerGroupSku const type. +func PossibleContainerGroupSkuValues() []ContainerGroupSku { + return []ContainerGroupSku{ContainerGroupSkuDedicated, ContainerGroupSkuStandard} +} + +// ContainerNetworkProtocol enumerates the values for container network protocol. +type ContainerNetworkProtocol string + +const ( + // ContainerNetworkProtocolTCP ... + ContainerNetworkProtocolTCP ContainerNetworkProtocol = "TCP" + // ContainerNetworkProtocolUDP ... + ContainerNetworkProtocolUDP ContainerNetworkProtocol = "UDP" +) + +// PossibleContainerNetworkProtocolValues returns an array of possible values for the ContainerNetworkProtocol const type. +func PossibleContainerNetworkProtocolValues() []ContainerNetworkProtocol { + return []ContainerNetworkProtocol{ContainerNetworkProtocolTCP, ContainerNetworkProtocolUDP} +} + +// GpuSku enumerates the values for gpu sku. +type GpuSku string + +const ( + // GpuSkuK80 ... + GpuSkuK80 GpuSku = "K80" + // GpuSkuP100 ... + GpuSkuP100 GpuSku = "P100" + // GpuSkuV100 ... + GpuSkuV100 GpuSku = "V100" +) + +// PossibleGpuSkuValues returns an array of possible values for the GpuSku const type. +func PossibleGpuSkuValues() []GpuSku { + return []GpuSku{GpuSkuK80, GpuSkuP100, GpuSkuV100} +} + +// LogAnalyticsLogType enumerates the values for log analytics log type. +type LogAnalyticsLogType string + +const ( + // LogAnalyticsLogTypeContainerInsights ... + LogAnalyticsLogTypeContainerInsights LogAnalyticsLogType = "ContainerInsights" + // LogAnalyticsLogTypeContainerInstanceLogs ... + LogAnalyticsLogTypeContainerInstanceLogs LogAnalyticsLogType = "ContainerInstanceLogs" +) + +// PossibleLogAnalyticsLogTypeValues returns an array of possible values for the LogAnalyticsLogType const type. +func PossibleLogAnalyticsLogTypeValues() []LogAnalyticsLogType { + return []LogAnalyticsLogType{LogAnalyticsLogTypeContainerInsights, LogAnalyticsLogTypeContainerInstanceLogs} +} + +// OperatingSystemTypes enumerates the values for operating system types. +type OperatingSystemTypes string + +const ( + // OperatingSystemTypesLinux ... + OperatingSystemTypesLinux OperatingSystemTypes = "Linux" + // OperatingSystemTypesWindows ... + OperatingSystemTypesWindows OperatingSystemTypes = "Windows" +) + +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{OperatingSystemTypesLinux, OperatingSystemTypesWindows} +} + +// OperationsOrigin enumerates the values for operations origin. +type OperationsOrigin string + +const ( + // OperationsOriginSystem ... + OperationsOriginSystem OperationsOrigin = "System" + // OperationsOriginUser ... + OperationsOriginUser OperationsOrigin = "User" +) + +// PossibleOperationsOriginValues returns an array of possible values for the OperationsOrigin const type. +func PossibleOperationsOriginValues() []OperationsOrigin { + return []OperationsOrigin{OperationsOriginSystem, OperationsOriginUser} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// Scheme enumerates the values for scheme. +type Scheme string + +const ( + // SchemeHTTP ... + SchemeHTTP Scheme = "http" + // SchemeHTTPS ... + SchemeHTTPS Scheme = "https" +) + +// PossibleSchemeValues returns an array of possible values for the Scheme const type. +func PossibleSchemeValues() []Scheme { + return []Scheme{SchemeHTTP, SchemeHTTPS} +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/location.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/location.go new file mode 100644 index 000000000000..c6b8aa0cf1d7 --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/location.go @@ -0,0 +1,337 @@ +package containerinstance + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LocationClient is the client for the Location methods of the Containerinstance service. +type LocationClient struct { + BaseClient +} + +// NewLocationClient creates an instance of the LocationClient client. +func NewLocationClient(subscriptionID string) LocationClient { + return NewLocationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLocationClientWithBaseURI creates an instance of the LocationClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewLocationClientWithBaseURI(baseURI string, subscriptionID string) LocationClient { + return LocationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListCachedImages get the list of cached images on specific OS type for a subscription in a region. +// Parameters: +// location - the identifier for the physical azure location. +func (client LocationClient) ListCachedImages(ctx context.Context, location string) (result CachedImagesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCachedImages") + defer func() { + sc := -1 + if result.cilr.Response.Response != nil { + sc = result.cilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listCachedImagesNextResults + req, err := client.ListCachedImagesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCachedImages", nil, "Failure preparing request") + return + } + + resp, err := client.ListCachedImagesSender(req) + if err != nil { + result.cilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCachedImages", resp, "Failure sending request") + return + } + + result.cilr, err = client.ListCachedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCachedImages", resp, "Failure responding to request") + return + } + if result.cilr.hasNextLink() && result.cilr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListCachedImagesPreparer prepares the ListCachedImages request. +func (client LocationClient) ListCachedImagesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCachedImagesSender sends the ListCachedImages request. The method will close the +// http.Response Body if it receives an error. +func (client LocationClient) ListCachedImagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCachedImagesResponder handles the response to the ListCachedImages request. The method always +// closes the http.Response Body. +func (client LocationClient) ListCachedImagesResponder(resp *http.Response) (result CachedImagesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCachedImagesNextResults retrieves the next set of results, if any. +func (client LocationClient) listCachedImagesNextResults(ctx context.Context, lastResults CachedImagesListResult) (result CachedImagesListResult, err error) { + req, err := lastResults.cachedImagesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCachedImagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCachedImagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCachedImagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCachedImagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCachedImagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCachedImagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client LocationClient) ListCachedImagesComplete(ctx context.Context, location string) (result CachedImagesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCachedImages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCachedImages(ctx, location) + return +} + +// ListCapabilities get the list of CPU/memory/GPU capabilities of a region. +// Parameters: +// location - the identifier for the physical azure location. +func (client LocationClient) ListCapabilities(ctx context.Context, location string) (result CapabilitiesListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCapabilities") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listCapabilitiesNextResults + req, err := client.ListCapabilitiesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCapabilities", nil, "Failure preparing request") + return + } + + resp, err := client.ListCapabilitiesSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCapabilities", resp, "Failure sending request") + return + } + + result.clr, err = client.ListCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListCapabilities", resp, "Failure responding to request") + return + } + if result.clr.hasNextLink() && result.clr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListCapabilitiesPreparer prepares the ListCapabilities request. +func (client LocationClient) ListCapabilitiesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCapabilitiesSender sends the ListCapabilities request. The method will close the +// http.Response Body if it receives an error. +func (client LocationClient) ListCapabilitiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCapabilitiesResponder handles the response to the ListCapabilities request. The method always +// closes the http.Response Body. +func (client LocationClient) ListCapabilitiesResponder(resp *http.Response) (result CapabilitiesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCapabilitiesNextResults retrieves the next set of results, if any. +func (client LocationClient) listCapabilitiesNextResults(ctx context.Context, lastResults CapabilitiesListResult) (result CapabilitiesListResult, err error) { + req, err := lastResults.capabilitiesListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCapabilitiesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCapabilitiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCapabilitiesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "listCapabilitiesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCapabilitiesComplete enumerates all values, automatically crossing page boundaries as required. +func (client LocationClient) ListCapabilitiesComplete(ctx context.Context, location string) (result CapabilitiesListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListCapabilities") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCapabilities(ctx, location) + return +} + +// ListUsage get the usage for a subscription +// Parameters: +// location - the identifier for the physical azure location. +func (client LocationClient) ListUsage(ctx context.Context, location string) (result UsageListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationClient.ListUsage") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListUsagePreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListUsage", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListUsage", resp, "Failure sending request") + return + } + + result, err = client.ListUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.LocationClient", "ListUsage", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagePreparer prepares the ListUsage request. +func (client LocationClient) ListUsagePreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsageSender sends the ListUsage request. The method will close the +// http.Response Body if it receives an error. +func (client LocationClient) ListUsageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsageResponder handles the response to the ListUsage request. The method always +// closes the http.Response Body. +func (client LocationClient) ListUsageResponder(resp *http.Response) (result UsageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/models.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/models.go new file mode 100644 index 000000000000..5a50331658ca --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/models.go @@ -0,0 +1,1849 @@ +package containerinstance + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance" + +// AzureFileVolume the properties of the Azure File volume. Azure File shares are mounted as volumes. +type AzureFileVolume struct { + // ShareName - The name of the Azure File share to be mounted as a volume. + ShareName *string `json:"shareName,omitempty"` + // ReadOnly - The flag indicating whether the Azure File shared mounted as a volume is read-only. + ReadOnly *bool `json:"readOnly,omitempty"` + // StorageAccountName - The name of the storage account that contains the Azure File share. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // StorageAccountKey - The storage account access key used to access the Azure File share. + StorageAccountKey *string `json:"storageAccountKey,omitempty"` +} + +// CachedImages the cached image and OS type. +type CachedImages struct { + // OsType - The OS type of the cached image. + OsType *string `json:"osType,omitempty"` + // Image - The cached image name. + Image *string `json:"image,omitempty"` +} + +// CachedImagesListResult the response containing cached images. +type CachedImagesListResult struct { + autorest.Response `json:"-"` + // Value - The list of cached images. + Value *[]CachedImages `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of cached images. + NextLink *string `json:"nextLink,omitempty"` +} + +// CachedImagesListResultIterator provides access to a complete listing of CachedImages values. +type CachedImagesListResultIterator struct { + i int + page CachedImagesListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CachedImagesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachedImagesListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CachedImagesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CachedImagesListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CachedImagesListResultIterator) Response() CachedImagesListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CachedImagesListResultIterator) Value() CachedImages { + if !iter.page.NotDone() { + return CachedImages{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CachedImagesListResultIterator type. +func NewCachedImagesListResultIterator(page CachedImagesListResultPage) CachedImagesListResultIterator { + return CachedImagesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cilr CachedImagesListResult) IsEmpty() bool { + return cilr.Value == nil || len(*cilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cilr CachedImagesListResult) hasNextLink() bool { + return cilr.NextLink != nil && len(*cilr.NextLink) != 0 +} + +// cachedImagesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cilr CachedImagesListResult) cachedImagesListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cilr.NextLink))) +} + +// CachedImagesListResultPage contains a page of CachedImages values. +type CachedImagesListResultPage struct { + fn func(context.Context, CachedImagesListResult) (CachedImagesListResult, error) + cilr CachedImagesListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CachedImagesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CachedImagesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cilr) + if err != nil { + return err + } + page.cilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CachedImagesListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CachedImagesListResultPage) NotDone() bool { + return !page.cilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CachedImagesListResultPage) Response() CachedImagesListResult { + return page.cilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CachedImagesListResultPage) Values() []CachedImages { + if page.cilr.IsEmpty() { + return nil + } + return *page.cilr.Value +} + +// Creates a new instance of the CachedImagesListResultPage type. +func NewCachedImagesListResultPage(cur CachedImagesListResult, getNextPage func(context.Context, CachedImagesListResult) (CachedImagesListResult, error)) CachedImagesListResultPage { + return CachedImagesListResultPage{ + fn: getNextPage, + cilr: cur, + } +} + +// Capabilities the regional capabilities. +type Capabilities struct { + // ResourceType - READ-ONLY; The resource type that this capability describes. + ResourceType *string `json:"resourceType,omitempty"` + // OsType - READ-ONLY; The OS type that this capability describes. + OsType *string `json:"osType,omitempty"` + // Location - READ-ONLY; The resource location. + Location *string `json:"location,omitempty"` + // IPAddressType - READ-ONLY; The ip address type that this capability describes. + IPAddressType *string `json:"ipAddressType,omitempty"` + // Gpu - READ-ONLY; The GPU sku that this capability describes. + Gpu *string `json:"gpu,omitempty"` + // Capabilities - READ-ONLY; The supported capabilities. + Capabilities *CapabilitiesCapabilities `json:"capabilities,omitempty"` +} + +// MarshalJSON is the custom marshaler for Capabilities. +func (c Capabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CapabilitiesCapabilities the supported capabilities. +type CapabilitiesCapabilities struct { + // MaxMemoryInGB - READ-ONLY; The maximum allowed memory request in GB. + MaxMemoryInGB *float64 `json:"maxMemoryInGB,omitempty"` + // MaxCPU - READ-ONLY; The maximum allowed CPU request in cores. + MaxCPU *float64 `json:"maxCpu,omitempty"` + // MaxGpuCount - READ-ONLY; The maximum allowed GPU count. + MaxGpuCount *float64 `json:"maxGpuCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapabilitiesCapabilities. +func (c CapabilitiesCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CapabilitiesListResult the response containing list of capabilities. +type CapabilitiesListResult struct { + autorest.Response `json:"-"` + // Value - The list of capabilities. + Value *[]Capabilities `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of capabilities. + NextLink *string `json:"nextLink,omitempty"` +} + +// CapabilitiesListResultIterator provides access to a complete listing of Capabilities values. +type CapabilitiesListResultIterator struct { + i int + page CapabilitiesListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CapabilitiesListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CapabilitiesListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CapabilitiesListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CapabilitiesListResultIterator) Response() CapabilitiesListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CapabilitiesListResultIterator) Value() Capabilities { + if !iter.page.NotDone() { + return Capabilities{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CapabilitiesListResultIterator type. +func NewCapabilitiesListResultIterator(page CapabilitiesListResultPage) CapabilitiesListResultIterator { + return CapabilitiesListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CapabilitiesListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (clr CapabilitiesListResult) hasNextLink() bool { + return clr.NextLink != nil && len(*clr.NextLink) != 0 +} + +// capabilitiesListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CapabilitiesListResult) capabilitiesListResultPreparer(ctx context.Context) (*http.Request, error) { + if !clr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CapabilitiesListResultPage contains a page of Capabilities values. +type CapabilitiesListResultPage struct { + fn func(context.Context, CapabilitiesListResult) (CapabilitiesListResult, error) + clr CapabilitiesListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CapabilitiesListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapabilitiesListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CapabilitiesListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CapabilitiesListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CapabilitiesListResultPage) Response() CapabilitiesListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CapabilitiesListResultPage) Values() []Capabilities { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the CapabilitiesListResultPage type. +func NewCapabilitiesListResultPage(cur CapabilitiesListResult, getNextPage func(context.Context, CapabilitiesListResult) (CapabilitiesListResult, error)) CapabilitiesListResultPage { + return CapabilitiesListResultPage{ + fn: getNextPage, + clr: cur, + } +} + +// CloudError an error response from the Container Instance service. +type CloudError struct { + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Container Instance service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// Container a container instance. +type Container struct { + // Name - The user-provided name of the container instance. + Name *string `json:"name,omitempty"` + // ContainerProperties - The properties of the container instance. + *ContainerProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Container. +func (c Container) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Name != nil { + objectMap["name"] = c.Name + } + if c.ContainerProperties != nil { + objectMap["properties"] = c.ContainerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Container struct. +func (c *Container) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "properties": + if v != nil { + var containerProperties ContainerProperties + err = json.Unmarshal(*v, &containerProperties) + if err != nil { + return err + } + c.ContainerProperties = &containerProperties + } + } + } + + return nil +} + +// ContainerAttachResponse the information for the output stream from container attach. +type ContainerAttachResponse struct { + autorest.Response `json:"-"` + // WebSocketURI - The uri for the output stream from the attach. + WebSocketURI *string `json:"webSocketUri,omitempty"` + // Password - The password to the output stream from the attach. Send as an Authorization header value when connecting to the websocketUri. + Password *string `json:"password,omitempty"` +} + +// ContainerExec the container execution command, for liveness or readiness probe +type ContainerExec struct { + // Command - The commands to execute within the container. + Command *[]string `json:"command,omitempty"` +} + +// ContainerExecRequest the container exec request. +type ContainerExecRequest struct { + // Command - The command to be executed. + Command *string `json:"command,omitempty"` + // TerminalSize - The size of the terminal. + TerminalSize *ContainerExecRequestTerminalSize `json:"terminalSize,omitempty"` +} + +// ContainerExecRequestTerminalSize the size of the terminal. +type ContainerExecRequestTerminalSize struct { + // Rows - The row size of the terminal + Rows *int32 `json:"rows,omitempty"` + // Cols - The column size of the terminal + Cols *int32 `json:"cols,omitempty"` +} + +// ContainerExecResponse the information for the container exec command. +type ContainerExecResponse struct { + autorest.Response `json:"-"` + // WebSocketURI - The uri for the exec websocket. + WebSocketURI *string `json:"webSocketUri,omitempty"` + // Password - The password to start the exec command. + Password *string `json:"password,omitempty"` +} + +// ContainerGroup a container group. +type ContainerGroup struct { + autorest.Response `json:"-"` + // Identity - The identity of the container group, if configured. + Identity *ContainerGroupIdentity `json:"identity,omitempty"` + // ContainerGroupProperties - The container group properties + *ContainerGroupProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Zones - The zones for the container group. + Zones *[]string `json:"zones,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerGroup. +func (cg ContainerGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cg.Identity != nil { + objectMap["identity"] = cg.Identity + } + if cg.ContainerGroupProperties != nil { + objectMap["properties"] = cg.ContainerGroupProperties + } + if cg.Location != nil { + objectMap["location"] = cg.Location + } + if cg.Tags != nil { + objectMap["tags"] = cg.Tags + } + if cg.Zones != nil { + objectMap["zones"] = cg.Zones + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerGroup struct. +func (cg *ContainerGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity ContainerGroupIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cg.Identity = &identity + } + case "properties": + if v != nil { + var containerGroupProperties ContainerGroupProperties + err = json.Unmarshal(*v, &containerGroupProperties) + if err != nil { + return err + } + cg.ContainerGroupProperties = &containerGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cg.Tags = tags + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + cg.Zones = &zones + } + } + } + + return nil +} + +// ContainerGroupDiagnostics container group diagnostic information. +type ContainerGroupDiagnostics struct { + // LogAnalytics - Container group log analytics information. + LogAnalytics *LogAnalytics `json:"logAnalytics,omitempty"` +} + +// ContainerGroupIdentity identity for the container group. +type ContainerGroupIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the container group identity. This property will only be provided for a system assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id associated with the container group. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ContainerGroupIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ContainerGroupIdentity. +func (cgiVar ContainerGroupIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgiVar.Type != "" { + objectMap["type"] = cgiVar.Type + } + if cgiVar.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = cgiVar.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ContainerGroupIdentityUserAssignedIdentitiesValue ... +type ContainerGroupIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerGroupIdentityUserAssignedIdentitiesValue. +func (cgiAiv ContainerGroupIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ContainerGroupListResult the container group list response that contains the container group properties. +type ContainerGroupListResult struct { + autorest.Response `json:"-"` + // Value - The list of container groups. + Value *[]ContainerGroup `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of container groups. + NextLink *string `json:"nextLink,omitempty"` +} + +// ContainerGroupListResultIterator provides access to a complete listing of ContainerGroup values. +type ContainerGroupListResultIterator struct { + i int + page ContainerGroupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ContainerGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ContainerGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ContainerGroupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ContainerGroupListResultIterator) Response() ContainerGroupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ContainerGroupListResultIterator) Value() ContainerGroup { + if !iter.page.NotDone() { + return ContainerGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ContainerGroupListResultIterator type. +func NewContainerGroupListResultIterator(page ContainerGroupListResultPage) ContainerGroupListResultIterator { + return ContainerGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cglr ContainerGroupListResult) IsEmpty() bool { + return cglr.Value == nil || len(*cglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cglr ContainerGroupListResult) hasNextLink() bool { + return cglr.NextLink != nil && len(*cglr.NextLink) != 0 +} + +// containerGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cglr ContainerGroupListResult) containerGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cglr.NextLink))) +} + +// ContainerGroupListResultPage contains a page of ContainerGroup values. +type ContainerGroupListResultPage struct { + fn func(context.Context, ContainerGroupListResult) (ContainerGroupListResult, error) + cglr ContainerGroupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ContainerGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerGroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cglr) + if err != nil { + return err + } + page.cglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ContainerGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ContainerGroupListResultPage) NotDone() bool { + return !page.cglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ContainerGroupListResultPage) Response() ContainerGroupListResult { + return page.cglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ContainerGroupListResultPage) Values() []ContainerGroup { + if page.cglr.IsEmpty() { + return nil + } + return *page.cglr.Value +} + +// Creates a new instance of the ContainerGroupListResultPage type. +func NewContainerGroupListResultPage(cur ContainerGroupListResult, getNextPage func(context.Context, ContainerGroupListResult) (ContainerGroupListResult, error)) ContainerGroupListResultPage { + return ContainerGroupListResultPage{ + fn: getNextPage, + cglr: cur, + } +} + +// ContainerGroupProperties the container group properties +type ContainerGroupProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the container group. This only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Containers - The containers within the container group. + Containers *[]Container `json:"containers,omitempty"` + // ImageRegistryCredentials - The image registry credentials by which the container group is created from. + ImageRegistryCredentials *[]ImageRegistryCredential `json:"imageRegistryCredentials,omitempty"` + // RestartPolicy - Restart policy for all containers within the container group. + // - `Always` Always restart + // - `OnFailure` Restart on failure + // - `Never` Never restart + // . Possible values include: 'ContainerGroupRestartPolicyAlways', 'ContainerGroupRestartPolicyOnFailure', 'ContainerGroupRestartPolicyNever' + RestartPolicy ContainerGroupRestartPolicy `json:"restartPolicy,omitempty"` + // IPAddress - The IP address type of the container group. + IPAddress *IPAddress `json:"ipAddress,omitempty"` + // OsType - The operating system type required by the containers in the container group. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // Volumes - The list of volumes that can be mounted by containers in this container group. + Volumes *[]Volume `json:"volumes,omitempty"` + // InstanceView - READ-ONLY; The instance view of the container group. Only valid in response. + InstanceView *ContainerGroupPropertiesInstanceView `json:"instanceView,omitempty"` + // Diagnostics - The diagnostic information for a container group. + Diagnostics *ContainerGroupDiagnostics `json:"diagnostics,omitempty"` + // SubnetIds - The subnet resource IDs for a container group. + SubnetIds *[]ContainerGroupSubnetID `json:"subnetIds,omitempty"` + // DNSConfig - The DNS config information for a container group. + DNSConfig *DNSConfiguration `json:"dnsConfig,omitempty"` + // Sku - The SKU for a container group. Possible values include: 'ContainerGroupSkuStandard', 'ContainerGroupSkuDedicated' + Sku ContainerGroupSku `json:"sku,omitempty"` + // EncryptionProperties - The encryption properties for a container group. + EncryptionProperties *EncryptionProperties `json:"encryptionProperties,omitempty"` + // InitContainers - The init containers for a container group. + InitContainers *[]InitContainerDefinition `json:"initContainers,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerGroupProperties. +func (cg ContainerGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cg.Containers != nil { + objectMap["containers"] = cg.Containers + } + if cg.ImageRegistryCredentials != nil { + objectMap["imageRegistryCredentials"] = cg.ImageRegistryCredentials + } + if cg.RestartPolicy != "" { + objectMap["restartPolicy"] = cg.RestartPolicy + } + if cg.IPAddress != nil { + objectMap["ipAddress"] = cg.IPAddress + } + if cg.OsType != "" { + objectMap["osType"] = cg.OsType + } + if cg.Volumes != nil { + objectMap["volumes"] = cg.Volumes + } + if cg.Diagnostics != nil { + objectMap["diagnostics"] = cg.Diagnostics + } + if cg.SubnetIds != nil { + objectMap["subnetIds"] = cg.SubnetIds + } + if cg.DNSConfig != nil { + objectMap["dnsConfig"] = cg.DNSConfig + } + if cg.Sku != "" { + objectMap["sku"] = cg.Sku + } + if cg.EncryptionProperties != nil { + objectMap["encryptionProperties"] = cg.EncryptionProperties + } + if cg.InitContainers != nil { + objectMap["initContainers"] = cg.InitContainers + } + return json.Marshal(objectMap) +} + +// ContainerGroupPropertiesInstanceView the instance view of the container group. Only valid in response. +type ContainerGroupPropertiesInstanceView struct { + // Events - READ-ONLY; The events of this container group. + Events *[]Event `json:"events,omitempty"` + // State - READ-ONLY; The state of the container group. Only valid in response. + State *string `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerGroupPropertiesInstanceView. +func (cgV ContainerGroupPropertiesInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ContainerGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerGroupsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerGroupsClient) (ContainerGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ContainerGroupsCreateOrUpdateFuture.Result. +func (future *ContainerGroupsCreateOrUpdateFuture) result(client ContainerGroupsClient) (cg ContainerGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cg.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cg.Response.Response, err = future.GetResult(sender); err == nil && cg.Response.Response.StatusCode != http.StatusNoContent { + cg, err = client.CreateOrUpdateResponder(cg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", cg.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerGroupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerGroupsClient) (ContainerGroup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerGroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ContainerGroupsDeleteFuture.Result. +func (future *ContainerGroupsDeleteFuture) result(client ContainerGroupsClient) (cg ContainerGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cg.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cg.Response.Response, err = future.GetResult(sender); err == nil && cg.Response.Response.StatusCode != http.StatusNoContent { + cg, err = client.DeleteResponder(cg.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsDeleteFuture", "Result", cg.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerGroupsRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerGroupsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerGroupsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ContainerGroupsRestartFuture.Result. +func (future *ContainerGroupsRestartFuture) result(client ContainerGroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsRestartFuture") + return + } + ar.Response = future.Response() + return +} + +// ContainerGroupsStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerGroupsStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerGroupsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ContainerGroupsStartFuture.Result. +func (future *ContainerGroupsStartFuture) result(client ContainerGroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// ContainerGroupSubnetID container group subnet information. +type ContainerGroupSubnetID struct { + // ID - Resource ID of virtual network and subnet. + ID *string `json:"id,omitempty"` + // Name - Friendly name for the subnet. + Name *string `json:"name,omitempty"` +} + +// ContainerHTTPGet the container Http Get settings, for liveness or readiness probe +type ContainerHTTPGet struct { + // Path - The path to probe. + Path *string `json:"path,omitempty"` + // Port - The port number to probe. + Port *int32 `json:"port,omitempty"` + // Scheme - The scheme. Possible values include: 'SchemeHTTP', 'SchemeHTTPS' + Scheme Scheme `json:"scheme,omitempty"` + // HTTPHeaders - The HTTP headers. + HTTPHeaders *[]HTTPHeader `json:"httpHeaders,omitempty"` +} + +// ContainerPort the port exposed on the container instance. +type ContainerPort struct { + // Protocol - The protocol associated with the port. Possible values include: 'ContainerNetworkProtocolTCP', 'ContainerNetworkProtocolUDP' + Protocol ContainerNetworkProtocol `json:"protocol,omitempty"` + // Port - The port number exposed within the container group. + Port *int32 `json:"port,omitempty"` +} + +// ContainerProbe the container probe, for liveness or readiness +type ContainerProbe struct { + // Exec - The execution command to probe + Exec *ContainerExec `json:"exec,omitempty"` + // HTTPGet - The Http Get settings to probe + HTTPGet *ContainerHTTPGet `json:"httpGet,omitempty"` + // InitialDelaySeconds - The initial delay seconds. + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + // PeriodSeconds - The period seconds. + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + // FailureThreshold - The failure threshold. + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + // SuccessThreshold - The success threshold. + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + // TimeoutSeconds - The timeout seconds. + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` +} + +// ContainerProperties the container instance properties. +type ContainerProperties struct { + // Image - The name of the image used to create the container instance. + Image *string `json:"image,omitempty"` + // Command - The commands to execute within the container instance in exec form. + Command *[]string `json:"command,omitempty"` + // Ports - The exposed ports on the container instance. + Ports *[]ContainerPort `json:"ports,omitempty"` + // EnvironmentVariables - The environment variables to set in the container instance. + EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` + // InstanceView - READ-ONLY; The instance view of the container instance. Only valid in response. + InstanceView *ContainerPropertiesInstanceView `json:"instanceView,omitempty"` + // Resources - The resource requirements of the container instance. + Resources *ResourceRequirements `json:"resources,omitempty"` + // VolumeMounts - The volume mounts available to the container instance. + VolumeMounts *[]VolumeMount `json:"volumeMounts,omitempty"` + // LivenessProbe - The liveness probe. + LivenessProbe *ContainerProbe `json:"livenessProbe,omitempty"` + // ReadinessProbe - The readiness probe. + ReadinessProbe *ContainerProbe `json:"readinessProbe,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerProperties. +func (cp ContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Image != nil { + objectMap["image"] = cp.Image + } + if cp.Command != nil { + objectMap["command"] = cp.Command + } + if cp.Ports != nil { + objectMap["ports"] = cp.Ports + } + if cp.EnvironmentVariables != nil { + objectMap["environmentVariables"] = cp.EnvironmentVariables + } + if cp.Resources != nil { + objectMap["resources"] = cp.Resources + } + if cp.VolumeMounts != nil { + objectMap["volumeMounts"] = cp.VolumeMounts + } + if cp.LivenessProbe != nil { + objectMap["livenessProbe"] = cp.LivenessProbe + } + if cp.ReadinessProbe != nil { + objectMap["readinessProbe"] = cp.ReadinessProbe + } + return json.Marshal(objectMap) +} + +// ContainerPropertiesInstanceView the instance view of the container instance. Only valid in response. +type ContainerPropertiesInstanceView struct { + // RestartCount - READ-ONLY; The number of times that the container instance has been restarted. + RestartCount *int32 `json:"restartCount,omitempty"` + // CurrentState - READ-ONLY; Current container instance state. + CurrentState *ContainerState `json:"currentState,omitempty"` + // PreviousState - READ-ONLY; Previous container instance state. + PreviousState *ContainerState `json:"previousState,omitempty"` + // Events - READ-ONLY; The events of the container instance. + Events *[]Event `json:"events,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerPropertiesInstanceView. +func (cpV ContainerPropertiesInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ContainerState the container instance state. +type ContainerState struct { + // State - READ-ONLY; The state of the container instance. + State *string `json:"state,omitempty"` + // StartTime - READ-ONLY; The date-time when the container instance state started. + StartTime *date.Time `json:"startTime,omitempty"` + // ExitCode - READ-ONLY; The container instance exit codes correspond to those from the `docker run` command. + ExitCode *int32 `json:"exitCode,omitempty"` + // FinishTime - READ-ONLY; The date-time when the container instance state finished. + FinishTime *date.Time `json:"finishTime,omitempty"` + // DetailStatus - READ-ONLY; The human-readable status of the container instance state. + DetailStatus *string `json:"detailStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerState. +func (cs ContainerState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DNSConfiguration DNS configuration for the container group. +type DNSConfiguration struct { + // NameServers - The DNS servers for the container group. + NameServers *[]string `json:"nameServers,omitempty"` + // SearchDomains - The DNS search domains for hostname lookup in the container group. + SearchDomains *string `json:"searchDomains,omitempty"` + // Options - The DNS options for the container group. + Options *string `json:"options,omitempty"` +} + +// EncryptionProperties the container group encryption properties. +type EncryptionProperties struct { + // VaultBaseURL - The keyvault base url. + VaultBaseURL *string `json:"vaultBaseUrl,omitempty"` + // KeyName - The encryption key name. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The encryption key version. + KeyVersion *string `json:"keyVersion,omitempty"` +} + +// EnvironmentVariable the environment variable to set within the container instance. +type EnvironmentVariable struct { + // Name - The name of the environment variable. + Name *string `json:"name,omitempty"` + // Value - The value of the environment variable. + Value *string `json:"value,omitempty"` + // SecureValue - The value of the secure environment variable. + SecureValue *string `json:"secureValue,omitempty"` +} + +// Event a container group or container instance event. +type Event struct { + // Count - READ-ONLY; The count of the event. + Count *int32 `json:"count,omitempty"` + // FirstTimestamp - READ-ONLY; The date-time of the earliest logged event. + FirstTimestamp *date.Time `json:"firstTimestamp,omitempty"` + // LastTimestamp - READ-ONLY; The date-time of the latest logged event. + LastTimestamp *date.Time `json:"lastTimestamp,omitempty"` + // Name - READ-ONLY; The event name. + Name *string `json:"name,omitempty"` + // Message - READ-ONLY; The event message. + Message *string `json:"message,omitempty"` + // Type - READ-ONLY; The event type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Event. +func (e Event) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GitRepoVolume represents a volume that is populated with the contents of a git repository +type GitRepoVolume struct { + // Directory - Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + Directory *string `json:"directory,omitempty"` + // Repository - Repository URL + Repository *string `json:"repository,omitempty"` + // Revision - Commit hash for the specified revision. + Revision *string `json:"revision,omitempty"` +} + +// GpuResource the GPU resource. +type GpuResource struct { + // Count - The count of the GPU resource. + Count *int32 `json:"count,omitempty"` + // Sku - The SKU of the GPU resource. Possible values include: 'GpuSkuK80', 'GpuSkuP100', 'GpuSkuV100' + Sku GpuSku `json:"sku,omitempty"` +} + +// HTTPHeader the HTTP header. +type HTTPHeader struct { + // Name - The header name. + Name *string `json:"name,omitempty"` + // Value - The header value. + Value *string `json:"value,omitempty"` +} + +// ImageRegistryCredential image registry credential. +type ImageRegistryCredential struct { + // Server - The Docker image registry server without a protocol such as "http" and "https". + Server *string `json:"server,omitempty"` + // Username - The username for the private registry. + Username *string `json:"username,omitempty"` + // Password - The password for the private registry. + Password *string `json:"password,omitempty"` + // Identity - The identity for the private registry. + Identity *string `json:"identity,omitempty"` + // IdentityURL - The identity URL for the private registry. + IdentityURL *string `json:"identityUrl,omitempty"` +} + +// InitContainerDefinition the init container definition. +type InitContainerDefinition struct { + // Name - The name for the init container. + Name *string `json:"name,omitempty"` + // InitContainerPropertiesDefinition - The properties for the init container. + *InitContainerPropertiesDefinition `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for InitContainerDefinition. +func (icd InitContainerDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icd.Name != nil { + objectMap["name"] = icd.Name + } + if icd.InitContainerPropertiesDefinition != nil { + objectMap["properties"] = icd.InitContainerPropertiesDefinition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for InitContainerDefinition struct. +func (icd *InitContainerDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + icd.Name = &name + } + case "properties": + if v != nil { + var initContainerPropertiesDefinition InitContainerPropertiesDefinition + err = json.Unmarshal(*v, &initContainerPropertiesDefinition) + if err != nil { + return err + } + icd.InitContainerPropertiesDefinition = &initContainerPropertiesDefinition + } + } + } + + return nil +} + +// InitContainerPropertiesDefinition the init container definition properties. +type InitContainerPropertiesDefinition struct { + // Image - The image of the init container. + Image *string `json:"image,omitempty"` + // Command - The command to execute within the init container in exec form. + Command *[]string `json:"command,omitempty"` + // EnvironmentVariables - The environment variables to set in the init container. + EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` + // InstanceView - READ-ONLY; The instance view of the init container. Only valid in response. + InstanceView *InitContainerPropertiesDefinitionInstanceView `json:"instanceView,omitempty"` + // VolumeMounts - The volume mounts available to the init container. + VolumeMounts *[]VolumeMount `json:"volumeMounts,omitempty"` +} + +// MarshalJSON is the custom marshaler for InitContainerPropertiesDefinition. +func (icpd InitContainerPropertiesDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icpd.Image != nil { + objectMap["image"] = icpd.Image + } + if icpd.Command != nil { + objectMap["command"] = icpd.Command + } + if icpd.EnvironmentVariables != nil { + objectMap["environmentVariables"] = icpd.EnvironmentVariables + } + if icpd.VolumeMounts != nil { + objectMap["volumeMounts"] = icpd.VolumeMounts + } + return json.Marshal(objectMap) +} + +// InitContainerPropertiesDefinitionInstanceView the instance view of the init container. Only valid in +// response. +type InitContainerPropertiesDefinitionInstanceView struct { + // RestartCount - READ-ONLY; The number of times that the init container has been restarted. + RestartCount *int32 `json:"restartCount,omitempty"` + // CurrentState - READ-ONLY; The current state of the init container. + CurrentState *ContainerState `json:"currentState,omitempty"` + // PreviousState - READ-ONLY; The previous state of the init container. + PreviousState *ContainerState `json:"previousState,omitempty"` + // Events - READ-ONLY; The events of the init container. + Events *[]Event `json:"events,omitempty"` +} + +// MarshalJSON is the custom marshaler for InitContainerPropertiesDefinitionInstanceView. +func (icpdV InitContainerPropertiesDefinitionInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IPAddress IP address for the container group. +type IPAddress struct { + // Ports - The list of ports exposed on the container group. + Ports *[]Port `json:"ports,omitempty"` + // Type - Specifies if the IP is exposed to the public internet or private VNET. Possible values include: 'ContainerGroupIPAddressTypePublic', 'ContainerGroupIPAddressTypePrivate' + Type ContainerGroupIPAddressType `json:"type,omitempty"` + // IP - The IP exposed to the public internet. + IP *string `json:"ip,omitempty"` + // DNSNameLabel - The Dns name label for the IP. + DNSNameLabel *string `json:"dnsNameLabel,omitempty"` + // DNSNameLabelReusePolicy - The value representing the security enum. Possible values include: 'AutoGeneratedDomainNameLabelScopeUnsecure', 'AutoGeneratedDomainNameLabelScopeTenantReuse', 'AutoGeneratedDomainNameLabelScopeSubscriptionReuse', 'AutoGeneratedDomainNameLabelScopeResourceGroupReuse', 'AutoGeneratedDomainNameLabelScopeNoreuse' + DNSNameLabelReusePolicy AutoGeneratedDomainNameLabelScope `json:"dnsNameLabelReusePolicy,omitempty"` + // Fqdn - READ-ONLY; The FQDN for the IP. + Fqdn *string `json:"fqdn,omitempty"` +} + +// MarshalJSON is the custom marshaler for IPAddress. +func (ia IPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ia.Ports != nil { + objectMap["ports"] = ia.Ports + } + if ia.Type != "" { + objectMap["type"] = ia.Type + } + if ia.IP != nil { + objectMap["ip"] = ia.IP + } + if ia.DNSNameLabel != nil { + objectMap["dnsNameLabel"] = ia.DNSNameLabel + } + if ia.DNSNameLabelReusePolicy != "" { + objectMap["dnsNameLabelReusePolicy"] = ia.DNSNameLabelReusePolicy + } + return json.Marshal(objectMap) +} + +// ListString ... +type ListString struct { + autorest.Response `json:"-"` + Value *[]string `json:"value,omitempty"` +} + +// LogAnalytics container group log analytics information. +type LogAnalytics struct { + // WorkspaceID - The workspace id for log analytics + WorkspaceID *string `json:"workspaceId,omitempty"` + // WorkspaceKey - The workspace key for log analytics + WorkspaceKey *string `json:"workspaceKey,omitempty"` + // LogType - The log type to be used. Possible values include: 'LogAnalyticsLogTypeContainerInsights', 'LogAnalyticsLogTypeContainerInstanceLogs' + LogType LogAnalyticsLogType `json:"logType,omitempty"` + // Metadata - Metadata for log analytics. + Metadata map[string]*string `json:"metadata"` + // WorkspaceResourceID - The workspace resource id for log analytics + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogAnalytics. +func (la LogAnalytics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if la.WorkspaceID != nil { + objectMap["workspaceId"] = la.WorkspaceID + } + if la.WorkspaceKey != nil { + objectMap["workspaceKey"] = la.WorkspaceKey + } + if la.LogType != "" { + objectMap["logType"] = la.LogType + } + if la.Metadata != nil { + objectMap["metadata"] = la.Metadata + } + if la.WorkspaceResourceID != nil { + objectMap["workspaceResourceId"] = la.WorkspaceResourceID + } + return json.Marshal(objectMap) +} + +// Logs the logs. +type Logs struct { + autorest.Response `json:"-"` + // Content - The content of the log. + Content *string `json:"content,omitempty"` +} + +// Operation an operation for Azure Container Instance service. +type Operation struct { + // Name - The name of the operation. + Name *string `json:"name,omitempty"` + // Display - The display information of the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Properties - The additional properties. + Properties interface{} `json:"properties,omitempty"` + // Origin - The intended executor of the operation. Possible values include: 'OperationsOriginUser', 'OperationsOriginSystem' + Origin OperationsOrigin `json:"origin,omitempty"` +} + +// OperationDisplay the display information of the operation. +type OperationDisplay struct { + // Provider - The name of the provider of the operation. + Provider *string `json:"provider,omitempty"` + // Resource - The name of the resource type of the operation. + Resource *string `json:"resource,omitempty"` + // Operation - The friendly name of the operation. + Operation *string `json:"operation,omitempty"` + // Description - The description of the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult the operation list response that contains all operations for Azure Container +// Instance service. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of operations. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// Port the port exposed on the container group. +type Port struct { + // Protocol - The protocol associated with the port. Possible values include: 'ContainerGroupNetworkProtocolTCP', 'ContainerGroupNetworkProtocolUDP' + Protocol ContainerGroupNetworkProtocol `json:"protocol,omitempty"` + // Port - The port number. + Port *int32 `json:"port,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; The resource id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Zones - The zones for the container group. + Zones *[]string `json:"zones,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Zones != nil { + objectMap["zones"] = r.Zones + } + return json.Marshal(objectMap) +} + +// ResourceLimits the resource limits. +type ResourceLimits struct { + // MemoryInGB - The memory limit in GB of this container instance. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // CPU - The CPU limit of this container instance. + CPU *float64 `json:"cpu,omitempty"` + // Gpu - The GPU limit of this container instance. + Gpu *GpuResource `json:"gpu,omitempty"` +} + +// ResourceRequests the resource requests. +type ResourceRequests struct { + // MemoryInGB - The memory request in GB of this container instance. + MemoryInGB *float64 `json:"memoryInGB,omitempty"` + // CPU - The CPU request of this container instance. + CPU *float64 `json:"cpu,omitempty"` + // Gpu - The GPU request of this container instance. + Gpu *GpuResource `json:"gpu,omitempty"` +} + +// ResourceRequirements the resource requirements. +type ResourceRequirements struct { + // Requests - The resource requests of this container instance. + Requests *ResourceRequests `json:"requests,omitempty"` + // Limits - The resource limits of this container instance. + Limits *ResourceLimits `json:"limits,omitempty"` +} + +// Usage a single usage result +type Usage struct { + // Unit - READ-ONLY; Unit of the usage result + Unit *string `json:"unit,omitempty"` + // CurrentValue - READ-ONLY; The current usage of the resource + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The maximum permitted usage of the resource. + Limit *int32 `json:"limit,omitempty"` + // Name - READ-ONLY; The name object of the resource + Name *UsageName `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UsageListResult the response containing the usage data +type UsageListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The usage data. + Value *[]Usage `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for UsageListResult. +func (ulr UsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UsageName the name object of the resource +type UsageName struct { + // Value - READ-ONLY; The name of the resource + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The localized name of the resource + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for UsageName. +func (u UsageName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Volume the properties of the volume. +type Volume struct { + // Name - The name of the volume. + Name *string `json:"name,omitempty"` + // AzureFile - The Azure File volume. + AzureFile *AzureFileVolume `json:"azureFile,omitempty"` + // EmptyDir - The empty directory volume. + EmptyDir interface{} `json:"emptyDir,omitempty"` + // Secret - The secret volume. + Secret map[string]*string `json:"secret"` + // GitRepo - The git repo volume. + GitRepo *GitRepoVolume `json:"gitRepo,omitempty"` +} + +// MarshalJSON is the custom marshaler for Volume. +func (vVar Volume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Name != nil { + objectMap["name"] = vVar.Name + } + if vVar.AzureFile != nil { + objectMap["azureFile"] = vVar.AzureFile + } + if vVar.EmptyDir != nil { + objectMap["emptyDir"] = vVar.EmptyDir + } + if vVar.Secret != nil { + objectMap["secret"] = vVar.Secret + } + if vVar.GitRepo != nil { + objectMap["gitRepo"] = vVar.GitRepo + } + return json.Marshal(objectMap) +} + +// VolumeMount the properties of the volume mount. +type VolumeMount struct { + // Name - The name of the volume mount. + Name *string `json:"name,omitempty"` + // MountPath - The path within the container where the volume should be mounted. Must not contain colon (:). + MountPath *string `json:"mountPath,omitempty"` + // ReadOnly - The flag indicating whether the volume mount is read-only. + ReadOnly *bool `json:"readOnly,omitempty"` +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/operations.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/operations.go new file mode 100644 index 000000000000..ebff0832c0ad --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/operations.go @@ -0,0 +1,140 @@ +package containerinstance + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Containerinstance service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list the operations for Azure Container Instance service. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerInstance/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerinstance.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/containerinstance/mgmt/2021-10-01/containerinstance/version.go b/services/containerinstance/mgmt/2021-10-01/containerinstance/version.go new file mode 100644 index 000000000000..363c3d9a3501 --- /dev/null +++ b/services/containerinstance/mgmt/2021-10-01/containerinstance/version.go @@ -0,0 +1,19 @@ +package containerinstance + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " containerinstance/2021-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} From 35b80d048a684832c021d3768fe8245ef85969cb Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 13:52:26 +0800 Subject: [PATCH 2/8] Generated from specification/containerservice/resource-manager/readme.md tag package-2022-02 (commit hash: 61218420e95ad3435a029144877b110b56418958) --- .../containerserviceapi/models.go | 2 +- .../mgmt/containerservice/models.go | 2 +- .../containerserviceapi/models.go | 2 +- .../mgmt/containerservice/models.go | 2 +- .../2022-02-01/containerservice/CHANGELOG.md | 2 + .../2022-02-01/containerservice/_meta.json | 11 + .../2022-02-01/containerservice/agentpools.go | 729 +++ .../2022-02-01/containerservice/client.go | 41 + .../containerserviceapi/interfaces.go | 112 + .../mgmt/2022-02-01/containerservice/enums.go | 979 ++++ .../maintenanceconfigurations.go | 440 ++ .../containerservice/managedclusters.go | 2043 +++++++++ .../2022-02-01/containerservice/models.go | 4007 +++++++++++++++++ .../2022-02-01/containerservice/operations.go | 98 + .../privateendpointconnections.go | 406 ++ .../containerservice/privatelinkresources.go | 122 + .../resolveprivatelinkserviceid.go | 126 + .../2022-02-01/containerservice/snapshots.go | 637 +++ .../2022-02-01/containerservice/version.go | 19 + 19 files changed, 9776 insertions(+), 4 deletions(-) create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/CHANGELOG.md create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/_meta.json create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/agentpools.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/client.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/containerserviceapi/interfaces.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/enums.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/maintenanceconfigurations.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/managedclusters.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/models.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/operations.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/privateendpointconnections.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/privatelinkresources.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/resolveprivatelinkserviceid.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/snapshots.go create mode 100644 services/containerservice/mgmt/2022-02-01/containerservice/version.go diff --git a/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go index 55076b895193..75d5ad40ed94 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -9,7 +9,7 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-01-01/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice/containerserviceapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI type MaintenanceConfigurationsClientAPI = original.MaintenanceConfigurationsClientAPI diff --git a/profiles/latest/containerservice/mgmt/containerservice/models.go b/profiles/latest/containerservice/mgmt/containerservice/models.go index 0ed0d0b09a93..94a3acb7ee55 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/models.go @@ -12,7 +12,7 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-01-01/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice" ) const ( diff --git a/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go index 55076b895193..75d5ad40ed94 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -9,7 +9,7 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-01-01/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice/containerserviceapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI type MaintenanceConfigurationsClientAPI = original.MaintenanceConfigurationsClientAPI diff --git a/profiles/preview/containerservice/mgmt/containerservice/models.go b/profiles/preview/containerservice/mgmt/containerservice/models.go index 2f9476ed30f2..5356b85ade98 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/models.go @@ -12,7 +12,7 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-01-01/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice" ) const ( diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/CHANGELOG.md b/services/containerservice/mgmt/2022-02-01/containerservice/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/_meta.json b/services/containerservice/mgmt/2022-02-01/containerservice/_meta.json new file mode 100644 index 000000000000..15b68b24a11a --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "61218420e95ad3435a029144877b110b56418958", + "readme": "/_/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md", + "tag": "package-2022-02", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/agentpools.go b/services/containerservice/mgmt/2022-02-01/containerservice/agentpools.go new file mode 100644 index 000000000000..29f809236fcc --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/agentpools.go @@ -0,0 +1,729 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AgentPoolsClient is the the Container Service Client. +type AgentPoolsClient struct { + BaseClient +} + +// NewAgentPoolsClient creates an instance of the AgentPoolsClient client. +func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient { + return NewAgentPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgentPoolsClientWithBaseURI creates an instance of the AgentPoolsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient { + return AgentPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +// parameters - the agent pool to create or update. +func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (result AgentPoolsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.KubeletConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.KubeletConfig.ContainerLogMaxFiles", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.KubeletConfig.ContainerLogMaxFiles", Name: validation.InclusiveMinimum, Rule: int64(2), Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, agentPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future AgentPoolsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPoolsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAvailableAgentPoolVersions see [supported Kubernetes +// versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version +// lifecycle. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolAvailableVersions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetAvailableAgentPoolVersions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error()) + } + + req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetAvailableAgentPoolVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure sending request") + return + } + + result, err = client.GetAvailableAgentPoolVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure responding to request") + return + } + + return +} + +// GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAvailableAgentPoolVersionsSender sends the GetAvailableAgentPoolVersions request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAvailableAgentPoolVersionsResponder handles the response to the GetAvailableAgentPoolVersions request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsResponder(resp *http.Response) (result AgentPoolAvailableVersions, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile sends the get upgrade profile request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure responding to request") + return + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client AgentPoolsClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetUpgradeProfileResponder(resp *http.Response) (result AgentPoolUpgradeProfile, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.aplr.Response.Response != nil { + sc = result.aplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure sending request") + return + } + + result.aplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure responding to request") + return + } + if result.aplr.hasNextLink() && result.aplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AgentPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) ListResponder(resp *http.Response) (result AgentPoolListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AgentPoolsClient) listNextResults(ctx context.Context, lastResults AgentPoolListResult) (result AgentPoolListResult, err error) { + req, err := lastResults.agentPoolListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AgentPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, resourceName) + return +} + +// UpgradeNodeImageVersion upgrading the node image version of an agent pool applies the newest OS and runtime updates +// to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, +// see: https://docs.microsoft.com/azure/aks/node-image-upgrade +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) UpgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsUpgradeNodeImageVersionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.UpgradeNodeImageVersion") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "UpgradeNodeImageVersion", err.Error()) + } + + req, err := client.UpgradeNodeImageVersionPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "UpgradeNodeImageVersion", nil, "Failure preparing request") + return + } + + result, err = client.UpgradeNodeImageVersionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "UpgradeNodeImageVersion", result.Response(), "Failure sending request") + return + } + + return +} + +// UpgradeNodeImageVersionPreparer prepares the UpgradeNodeImageVersion request. +func (client AgentPoolsClient) UpgradeNodeImageVersionPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpgradeNodeImageVersionSender sends the UpgradeNodeImageVersion request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) UpgradeNodeImageVersionSender(req *http.Request) (future AgentPoolsUpgradeNodeImageVersionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpgradeNodeImageVersionResponder handles the response to the UpgradeNodeImageVersion request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) UpgradeNodeImageVersionResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/client.go b/services/containerservice/mgmt/2022-02-01/containerservice/client.go new file mode 100644 index 000000000000..9c50bece64d3 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/client.go @@ -0,0 +1,41 @@ +// Package containerservice implements the Azure ARM Containerservice service API version 2022-02-01. +// +// The Container Service Client. +package containerservice + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerservice + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerservice. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/containerserviceapi/interfaces.go b/services/containerservice/mgmt/2022-02-01/containerservice/containerserviceapi/interfaces.go new file mode 100644 index 000000000000..960ea22eed51 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/containerserviceapi/interfaces.go @@ -0,0 +1,112 @@ +package containerserviceapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerservice.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*containerservice.OperationsClient)(nil) + +// ManagedClustersClientAPI contains the set of methods on the ManagedClustersClient type. +type ManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedCluster) (result containerservice.ManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedCluster, err error) + GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result containerservice.ManagedClusterAccessProfile, err error) + GetCommandResult(ctx context.Context, resourceGroupName string, resourceName string, commandID string) (result containerservice.RunCommandResult, err error) + GetOSOptions(ctx context.Context, location string, resourceType string) (result containerservice.OSOptionProfile, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClusterUpgradeProfile, err error) + List(ctx context.Context) (result containerservice.ManagedClusterListResultPage, err error) + ListComplete(ctx context.Context) (result containerservice.ManagedClusterListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ManagedClusterListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerservice.ManagedClusterListResultIterator, err error) + ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (result containerservice.CredentialResults, err error) + ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (result containerservice.CredentialResults, err error) + ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string, formatParameter containerservice.Format) (result containerservice.CredentialResults, err error) + ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OutboundEnvironmentEndpointCollectionPage, err error) + ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OutboundEnvironmentEndpointCollectionIterator, err error) + ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterAADProfile) (result containerservice.ManagedClustersResetAADProfileFuture, err error) + ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterServicePrincipalProfile) (result containerservice.ManagedClustersResetServicePrincipalProfileFuture, err error) + RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersRotateClusterCertificatesFuture, err error) + RunCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload containerservice.RunCommandRequest) (result containerservice.ManagedClustersRunCommandFuture, err error) + Start(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersStopFuture, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.ManagedClustersUpdateTagsFuture, err error) +} + +var _ ManagedClustersClientAPI = (*containerservice.ManagedClustersClient)(nil) + +// MaintenanceConfigurationsClientAPI contains the set of methods on the MaintenanceConfigurationsClient type. +type MaintenanceConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters containerservice.MaintenanceConfiguration) (result containerservice.MaintenanceConfiguration, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, configName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, configName string) (result containerservice.MaintenanceConfiguration, err error) + ListByManagedCluster(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.MaintenanceConfigurationListResultPage, err error) + ListByManagedClusterComplete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.MaintenanceConfigurationListResultIterator, err error) +} + +var _ MaintenanceConfigurationsClientAPI = (*containerservice.MaintenanceConfigurationsClient)(nil) + +// AgentPoolsClientAPI contains the set of methods on the AgentPoolsClient type. +type AgentPoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters containerservice.AgentPool) (result containerservice.AgentPoolsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPool, err error) + GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolAvailableVersions, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolUpgradeProfile, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolListResultIterator, err error) + UpgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolsUpgradeNodeImageVersionFuture, err error) +} + +var _ AgentPoolsClientAPI = (*containerservice.AgentPoolsClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result containerservice.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result containerservice.PrivateEndpointConnection, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.PrivateEndpointConnectionListResult, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters containerservice.PrivateEndpointConnection) (result containerservice.PrivateEndpointConnection, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*containerservice.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + List(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.PrivateLinkResourcesListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*containerservice.PrivateLinkResourcesClient)(nil) + +// ResolvePrivateLinkServiceIDClientAPI contains the set of methods on the ResolvePrivateLinkServiceIDClient type. +type ResolvePrivateLinkServiceIDClientAPI interface { + POST(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.PrivateLinkResource) (result containerservice.PrivateLinkResource, err error) +} + +var _ ResolvePrivateLinkServiceIDClientAPI = (*containerservice.ResolvePrivateLinkServiceIDClient)(nil) + +// SnapshotsClientAPI contains the set of methods on the SnapshotsClient type. +type SnapshotsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.Snapshot) (result containerservice.Snapshot, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.Snapshot, err error) + List(ctx context.Context) (result containerservice.SnapshotListResultPage, err error) + ListComplete(ctx context.Context) (result containerservice.SnapshotListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.SnapshotListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerservice.SnapshotListResultIterator, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.Snapshot, err error) +} + +var _ SnapshotsClientAPI = (*containerservice.SnapshotsClient)(nil) diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/enums.go b/services/containerservice/mgmt/2022-02-01/containerservice/enums.go new file mode 100644 index 000000000000..7b4dad1a3714 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/enums.go @@ -0,0 +1,979 @@ +package containerservice + +// 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. + +// AgentPoolMode enumerates the values for agent pool mode. +type AgentPoolMode string + +const ( + // AgentPoolModeSystem System agent pools are primarily for hosting critical system pods such as CoreDNS + // and metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + // least 2vCPUs and 4GB of memory. + AgentPoolModeSystem AgentPoolMode = "System" + // AgentPoolModeUser User agent pools are primarily for hosting your application pods. + AgentPoolModeUser AgentPoolMode = "User" +) + +// PossibleAgentPoolModeValues returns an array of possible values for the AgentPoolMode const type. +func PossibleAgentPoolModeValues() []AgentPoolMode { + return []AgentPoolMode{AgentPoolModeSystem, AgentPoolModeUser} +} + +// AgentPoolType enumerates the values for agent pool type. +type AgentPoolType string + +const ( + // AgentPoolTypeAvailabilitySet Use of this is strongly discouraged. + AgentPoolTypeAvailabilitySet AgentPoolType = "AvailabilitySet" + // AgentPoolTypeVirtualMachineScaleSets Create an Agent Pool backed by a Virtual Machine Scale Set. + AgentPoolTypeVirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type. +func PossibleAgentPoolTypeValues() []AgentPoolType { + return []AgentPoolType{AgentPoolTypeAvailabilitySet, AgentPoolTypeVirtualMachineScaleSets} +} + +// Code enumerates the values for code. +type Code string + +const ( + // CodeRunning The cluster is running. + CodeRunning Code = "Running" + // CodeStopped The cluster is stopped. + CodeStopped Code = "Stopped" +) + +// PossibleCodeValues returns an array of possible values for the Code const type. +func PossibleCodeValues() []Code { + return []Code{CodeRunning, CodeStopped} +} + +// ConnectionStatus enumerates the values for connection status. +type ConnectionStatus string + +const ( + // ConnectionStatusApproved ... + ConnectionStatusApproved ConnectionStatus = "Approved" + // ConnectionStatusDisconnected ... + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + // ConnectionStatusPending ... + ConnectionStatusPending ConnectionStatus = "Pending" + // ConnectionStatusRejected ... + ConnectionStatusRejected ConnectionStatus = "Rejected" +) + +// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ConnectionStatusApproved, ConnectionStatusDisconnected, ConnectionStatusPending, ConnectionStatusRejected} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// Expander enumerates the values for expander. +type Expander string + +const ( + // ExpanderLeastWaste Selects the node group that will have the least idle CPU (if tied, unused memory) + // after scale-up. This is useful when you have different classes of nodes, for example, high CPU or high + // memory nodes, and only want to expand those when there are pending pods that need a lot of those + // resources. + ExpanderLeastWaste Expander = "least-waste" + // ExpanderMostPods Selects the node group that would be able to schedule the most pods when scaling up. + // This is useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + // that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple smaller + // nodes at once. + ExpanderMostPods Expander = "most-pods" + // ExpanderPriority Selects the node group that has the highest priority assigned by the user. It's + // configuration is described in more details + // [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md). + ExpanderPriority Expander = "priority" + // ExpanderRandom Used when you don't have a particular need for the node groups to scale differently. + ExpanderRandom Expander = "random" +) + +// PossibleExpanderValues returns an array of possible values for the Expander const type. +func PossibleExpanderValues() []Expander { + return []Expander{ExpanderLeastWaste, ExpanderMostPods, ExpanderPriority, ExpanderRandom} +} + +// ExtendedLocationTypes enumerates the values for extended location types. +type ExtendedLocationTypes string + +const ( + // ExtendedLocationTypesEdgeZone ... + ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" +) + +// PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. +func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { + return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone} +} + +// Format enumerates the values for format. +type Format string + +const ( + // FormatAzure Return azure auth-provider kubeconfig. This format is deprecated in 1.22 and will be fully + // removed in 1.25. + FormatAzure Format = "azure" + // FormatExec Return exec format kubeconfig. This format requires kubelogin binary in the path. + FormatExec Format = "exec" +) + +// PossibleFormatValues returns an array of possible values for the Format const type. +func PossibleFormatValues() []Format { + return []Format{FormatAzure, FormatExec} +} + +// GPUInstanceProfile enumerates the values for gpu instance profile. +type GPUInstanceProfile string + +const ( + // GPUInstanceProfileMIG1g ... + GPUInstanceProfileMIG1g GPUInstanceProfile = "MIG1g" + // GPUInstanceProfileMIG2g ... + GPUInstanceProfileMIG2g GPUInstanceProfile = "MIG2g" + // GPUInstanceProfileMIG3g ... + GPUInstanceProfileMIG3g GPUInstanceProfile = "MIG3g" + // GPUInstanceProfileMIG4g ... + GPUInstanceProfileMIG4g GPUInstanceProfile = "MIG4g" + // GPUInstanceProfileMIG7g ... + GPUInstanceProfileMIG7g GPUInstanceProfile = "MIG7g" +) + +// PossibleGPUInstanceProfileValues returns an array of possible values for the GPUInstanceProfile const type. +func PossibleGPUInstanceProfileValues() []GPUInstanceProfile { + return []GPUInstanceProfile{GPUInstanceProfileMIG1g, GPUInstanceProfileMIG2g, GPUInstanceProfileMIG3g, GPUInstanceProfileMIG4g, GPUInstanceProfileMIG7g} +} + +// IPFamily enumerates the values for ip family. +type IPFamily string + +const ( + // IPFamilyIPv4 ... + IPFamilyIPv4 IPFamily = "IPv4" + // IPFamilyIPv6 ... + IPFamilyIPv6 IPFamily = "IPv6" +) + +// PossibleIPFamilyValues returns an array of possible values for the IPFamily const type. +func PossibleIPFamilyValues() []IPFamily { + return []IPFamily{IPFamilyIPv4, IPFamilyIPv6} +} + +// KubeletDiskType enumerates the values for kubelet disk type. +type KubeletDiskType string + +const ( + // KubeletDiskTypeOS Kubelet will use the OS disk for its data. + KubeletDiskTypeOS KubeletDiskType = "OS" + // KubeletDiskTypeTemporary Kubelet will use the temporary disk for its data. + KubeletDiskTypeTemporary KubeletDiskType = "Temporary" +) + +// PossibleKubeletDiskTypeValues returns an array of possible values for the KubeletDiskType const type. +func PossibleKubeletDiskTypeValues() []KubeletDiskType { + return []KubeletDiskType{KubeletDiskTypeOS, KubeletDiskTypeTemporary} +} + +// LicenseType enumerates the values for license type. +type LicenseType string + +const ( + // LicenseTypeNone No additional licensing is applied. + LicenseTypeNone LicenseType = "None" + // LicenseTypeWindowsServer Enables Azure Hybrid User Benefits for Windows VMs. + LicenseTypeWindowsServer LicenseType = "Windows_Server" +) + +// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{LicenseTypeNone, LicenseTypeWindowsServer} +} + +// LoadBalancerSku enumerates the values for load balancer sku. +type LoadBalancerSku string + +const ( + // LoadBalancerSkuBasic Use a basic Load Balancer with limited functionality. + LoadBalancerSkuBasic LoadBalancerSku = "basic" + // LoadBalancerSkuStandard Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For + // more information about on working with the load balancer in the managed cluster, see the [standard Load + // Balancer](https://docs.microsoft.com/azure/aks/load-balancer-standard) article. + LoadBalancerSkuStandard LoadBalancerSku = "standard" +) + +// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type. +func PossibleLoadBalancerSkuValues() []LoadBalancerSku { + return []LoadBalancerSku{LoadBalancerSkuBasic, LoadBalancerSkuStandard} +} + +// ManagedClusterPodIdentityProvisioningState enumerates the values for managed cluster pod identity +// provisioning state. +type ManagedClusterPodIdentityProvisioningState string + +const ( + // ManagedClusterPodIdentityProvisioningStateAssigned ... + ManagedClusterPodIdentityProvisioningStateAssigned ManagedClusterPodIdentityProvisioningState = "Assigned" + // ManagedClusterPodIdentityProvisioningStateDeleting ... + ManagedClusterPodIdentityProvisioningStateDeleting ManagedClusterPodIdentityProvisioningState = "Deleting" + // ManagedClusterPodIdentityProvisioningStateFailed ... + ManagedClusterPodIdentityProvisioningStateFailed ManagedClusterPodIdentityProvisioningState = "Failed" + // ManagedClusterPodIdentityProvisioningStateUpdating ... + ManagedClusterPodIdentityProvisioningStateUpdating ManagedClusterPodIdentityProvisioningState = "Updating" +) + +// PossibleManagedClusterPodIdentityProvisioningStateValues returns an array of possible values for the ManagedClusterPodIdentityProvisioningState const type. +func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedClusterPodIdentityProvisioningState { + return []ManagedClusterPodIdentityProvisioningState{ManagedClusterPodIdentityProvisioningStateAssigned, ManagedClusterPodIdentityProvisioningStateDeleting, ManagedClusterPodIdentityProvisioningStateFailed, ManagedClusterPodIdentityProvisioningStateUpdating} +} + +// ManagedClusterSKUName enumerates the values for managed cluster sku name. +type ManagedClusterSKUName string + +const ( + // ManagedClusterSKUNameBasic ... + ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" +) + +// PossibleManagedClusterSKUNameValues returns an array of possible values for the ManagedClusterSKUName const type. +func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { + return []ManagedClusterSKUName{ManagedClusterSKUNameBasic} +} + +// ManagedClusterSKUTier enumerates the values for managed cluster sku tier. +type ManagedClusterSKUTier string + +const ( + // ManagedClusterSKUTierFree No guaranteed SLA, no additional charges. Free tier clusters have an SLO of + // 99.5%. + ManagedClusterSKUTierFree ManagedClusterSKUTier = "Free" + // ManagedClusterSKUTierPaid Guarantees 99.95% availability of the Kubernetes API server endpoint for + // clusters that use Availability Zones and 99.9% of availability for clusters that don't use Availability + // Zones. + ManagedClusterSKUTierPaid ManagedClusterSKUTier = "Paid" +) + +// PossibleManagedClusterSKUTierValues returns an array of possible values for the ManagedClusterSKUTier const type. +func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { + return []ManagedClusterSKUTier{ManagedClusterSKUTierFree, ManagedClusterSKUTierPaid} +} + +// NetworkMode enumerates the values for network mode. +type NetworkMode string + +const ( + // NetworkModeBridge This is no longer supported + NetworkModeBridge NetworkMode = "bridge" + // NetworkModeTransparent No bridge is created. Intra-VM Pod to Pod communication is through IP routes + // created by Azure CNI. See [Transparent Mode](https://docs.microsoft.com/azure/aks/faq#transparent-mode) + // for more information. + NetworkModeTransparent NetworkMode = "transparent" +) + +// PossibleNetworkModeValues returns an array of possible values for the NetworkMode const type. +func PossibleNetworkModeValues() []NetworkMode { + return []NetworkMode{NetworkModeBridge, NetworkModeTransparent} +} + +// NetworkPlugin enumerates the values for network plugin. +type NetworkPlugin string + +const ( + // NetworkPluginAzure Use the Azure CNI network plugin. See [Azure CNI (advanced) + // networking](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) for + // more information. + NetworkPluginAzure NetworkPlugin = "azure" + // NetworkPluginKubenet Use the Kubenet network plugin. See [Kubenet (basic) + // networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) for more + // information. + NetworkPluginKubenet NetworkPlugin = "kubenet" +) + +// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{NetworkPluginAzure, NetworkPluginKubenet} +} + +// NetworkPolicy enumerates the values for network policy. +type NetworkPolicy string + +const ( + // NetworkPolicyAzure Use Azure network policies. See [differences between Azure and Calico + // policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) + // for more information. + NetworkPolicyAzure NetworkPolicy = "azure" + // NetworkPolicyCalico Use Calico network policies. See [differences between Azure and Calico + // policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities) + // for more information. + NetworkPolicyCalico NetworkPolicy = "calico" +) + +// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico} +} + +// OSDiskType enumerates the values for os disk type. +type OSDiskType string + +const ( + // OSDiskTypeEphemeral Ephemeral OS disks are stored only on the host machine, just like a temporary disk. + // This provides lower read/write latency, along with faster node scaling and cluster upgrades. + OSDiskTypeEphemeral OSDiskType = "Ephemeral" + // OSDiskTypeManaged Azure replicates the operating system disk for a virtual machine to Azure storage to + // avoid data loss should the VM need to be relocated to another host. Since containers aren't designed to + // have local state persisted, this behavior offers limited value while providing some drawbacks, including + // slower node provisioning and higher read/write latency. + OSDiskTypeManaged OSDiskType = "Managed" +) + +// PossibleOSDiskTypeValues returns an array of possible values for the OSDiskType const type. +func PossibleOSDiskTypeValues() []OSDiskType { + return []OSDiskType{OSDiskTypeEphemeral, OSDiskTypeManaged} +} + +// OSSKU enumerates the values for ossku. +type OSSKU string + +const ( + // OSSKUCBLMariner ... + OSSKUCBLMariner OSSKU = "CBLMariner" + // OSSKUUbuntu ... + OSSKUUbuntu OSSKU = "Ubuntu" +) + +// PossibleOSSKUValues returns an array of possible values for the OSSKU const type. +func PossibleOSSKUValues() []OSSKU { + return []OSSKU{OSSKUCBLMariner, OSSKUUbuntu} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // OSTypeLinux Use Linux. + OSTypeLinux OSType = "Linux" + // OSTypeWindows Use Windows. + OSTypeWindows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{OSTypeLinux, OSTypeWindows} +} + +// OutboundType enumerates the values for outbound type. +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'. For more information see [outbound type + // loadbalancer](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-loadbalancer). + OutboundTypeLoadBalancer OutboundType = "loadBalancer" + // OutboundTypeManagedNATGateway The AKS-managed NAT gateway is used for egress. + OutboundTypeManagedNATGateway OutboundType = "managedNATGateway" + // OutboundTypeUserAssignedNATGateway The user-assigned NAT gateway associated to the cluster subnet is + // used for egress. This is an advanced scenario and requires proper network configuration. + OutboundTypeUserAssignedNATGateway OutboundType = "userAssignedNATGateway" + // OutboundTypeUserDefinedRouting Egress paths must be defined by the user. This is an advanced scenario + // and requires proper network configuration. For more information see [outbound type + // userDefinedRouting](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-userdefinedrouting). + OutboundTypeUserDefinedRouting OutboundType = "userDefinedRouting" +) + +// PossibleOutboundTypeValues returns an array of possible values for the OutboundType const type. +func PossibleOutboundTypeValues() []OutboundType { + return []OutboundType{OutboundTypeLoadBalancer, OutboundTypeManagedNATGateway, OutboundTypeUserAssignedNATGateway, OutboundTypeUserDefinedRouting} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // PrivateEndpointConnectionProvisioningStateCreating ... + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting ... + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed ... + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded ... + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled ... + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled ... + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone Do not use a managed identity for the Managed Cluster, service principal will + // be used instead. + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned Use an implicitly created system assigned managed identity to manage + // cluster resources. Master components in the control plane such as kube-controller-manager will use the + // system assigned managed identity to manipulate Azure resources. + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeUserAssigned Use a user-specified identity to manage cluster resources. Master + // components in the control plane such as kube-controller-manager will use the specified user assigned + // managed identity to manipulate Azure resources. + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeUserAssigned} +} + +// ScaleDownMode enumerates the values for scale down mode. +type ScaleDownMode string + +const ( + // ScaleDownModeDeallocate Attempt to start deallocated instances (if they exist) during scale up and + // deallocate instances during scale down. + ScaleDownModeDeallocate ScaleDownMode = "Deallocate" + // ScaleDownModeDelete Create new instances during scale up and remove instances during scale down. + ScaleDownModeDelete ScaleDownMode = "Delete" +) + +// PossibleScaleDownModeValues returns an array of possible values for the ScaleDownMode const type. +func PossibleScaleDownModeValues() []ScaleDownMode { + return []ScaleDownMode{ScaleDownModeDeallocate, ScaleDownModeDelete} +} + +// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy. +type ScaleSetEvictionPolicy string + +const ( + // ScaleSetEvictionPolicyDeallocate Nodes in the underlying Scale Set of the node pool are set to the + // stopped-deallocated state upon eviction. Nodes in the stopped-deallocated state count against your + // compute quota and can cause issues with cluster scaling or upgrading. + ScaleSetEvictionPolicyDeallocate ScaleSetEvictionPolicy = "Deallocate" + // ScaleSetEvictionPolicyDelete Nodes in the underlying Scale Set of the node pool are deleted when they're + // evicted. + ScaleSetEvictionPolicyDelete ScaleSetEvictionPolicy = "Delete" +) + +// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type. +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return []ScaleSetEvictionPolicy{ScaleSetEvictionPolicyDeallocate, ScaleSetEvictionPolicyDelete} +} + +// ScaleSetPriority enumerates the values for scale set priority. +type ScaleSetPriority string + +const ( + // ScaleSetPriorityRegular Regular VMs will be used. + ScaleSetPriorityRegular ScaleSetPriority = "Regular" + // ScaleSetPrioritySpot Spot priority VMs will be used. There is no SLA for spot nodes. See [spot on + // AKS](https://docs.microsoft.com/azure/aks/spot-node-pool) for more information. + ScaleSetPrioritySpot ScaleSetPriority = "Spot" +) + +// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type. +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return []ScaleSetPriority{ScaleSetPriorityRegular, ScaleSetPrioritySpot} +} + +// SnapshotType enumerates the values for snapshot type. +type SnapshotType string + +const ( + // SnapshotTypeNodePool The snapshot is a snapshot of a node pool. + SnapshotTypeNodePool SnapshotType = "NodePool" +) + +// PossibleSnapshotTypeValues returns an array of possible values for the SnapshotType const type. +func PossibleSnapshotTypeValues() []SnapshotType { + return []SnapshotType{SnapshotTypeNodePool} +} + +// StorageProfileTypes enumerates the values for storage profile types. +type StorageProfileTypes string + +const ( + // StorageProfileTypesManagedDisks ... + StorageProfileTypesManagedDisks StorageProfileTypes = "ManagedDisks" + // StorageProfileTypesStorageAccount ... + StorageProfileTypesStorageAccount StorageProfileTypes = "StorageAccount" +) + +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{StorageProfileTypesManagedDisks, StorageProfileTypesStorageAccount} +} + +// UpgradeChannel enumerates the values for upgrade channel. +type UpgradeChannel string + +const ( + // UpgradeChannelNodeImage Automatically upgrade the node image to the latest version available. Microsoft + // provides patches and new images for image nodes frequently (usually weekly), but your running nodes + // won't get the new images unless you do a node image upgrade. Turning on the node-image channel will + // automatically update your node images whenever a new version is available. + UpgradeChannelNodeImage UpgradeChannel = "node-image" + // UpgradeChannelNone Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + UpgradeChannelNone UpgradeChannel = "none" + // UpgradeChannelPatch Automatically upgrade the cluster to the latest supported patch version when it + // becomes available while keeping the minor version the same. For example, if a cluster is running version + // 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to + // 1.17.9. + UpgradeChannelPatch UpgradeChannel = "patch" + // UpgradeChannelRapid Automatically upgrade the cluster to the latest supported patch release on the + // latest supported minor version. In cases where the cluster is at a version of Kubernetes that is at an + // N-2 minor version where N is the latest supported minor version, the cluster first upgrades to the + // latest supported patch version on N-1 minor version. For example, if a cluster is running version 1.17.7 + // and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is upgraded to 1.18.6, + // then is upgraded to 1.19.1. + UpgradeChannelRapid UpgradeChannel = "rapid" + // UpgradeChannelStable Automatically upgrade the cluster to the latest supported patch release on minor + // version N-1, where N is the latest supported minor version. For example, if a cluster is running version + // 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to + // 1.18.6. + UpgradeChannelStable UpgradeChannel = "stable" +) + +// PossibleUpgradeChannelValues returns an array of possible values for the UpgradeChannel const type. +func PossibleUpgradeChannelValues() []UpgradeChannel { + return []UpgradeChannel{UpgradeChannelNodeImage, UpgradeChannelNone, UpgradeChannelPatch, UpgradeChannelRapid, UpgradeChannelStable} +} + +// VMSizeTypes enumerates the values for vm size types. +type VMSizeTypes string + +const ( + // VMSizeTypesStandardA1 ... + VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1" + // VMSizeTypesStandardA10 ... + VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10" + // VMSizeTypesStandardA11 ... + VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11" + // VMSizeTypesStandardA1V2 ... + VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2" + // VMSizeTypesStandardA2 ... + VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2" + // VMSizeTypesStandardA2mV2 ... + VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2" + // VMSizeTypesStandardA2V2 ... + VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2" + // VMSizeTypesStandardA3 ... + VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3" + // VMSizeTypesStandardA4 ... + VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4" + // VMSizeTypesStandardA4mV2 ... + VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2" + // VMSizeTypesStandardA4V2 ... + VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2" + // VMSizeTypesStandardA5 ... + VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5" + // VMSizeTypesStandardA6 ... + VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6" + // VMSizeTypesStandardA7 ... + VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7" + // VMSizeTypesStandardA8 ... + VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8" + // VMSizeTypesStandardA8mV2 ... + VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2" + // VMSizeTypesStandardA8V2 ... + VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2" + // VMSizeTypesStandardA9 ... + VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9" + // VMSizeTypesStandardB2ms ... + VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms" + // VMSizeTypesStandardB2s ... + VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s" + // VMSizeTypesStandardB4ms ... + VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms" + // VMSizeTypesStandardB8ms ... + VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms" + // VMSizeTypesStandardD1 ... + VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1" + // VMSizeTypesStandardD11 ... + VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11" + // VMSizeTypesStandardD11V2 ... + VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2" + // VMSizeTypesStandardD11V2Promo ... + VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" + // VMSizeTypesStandardD12 ... + VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12" + // VMSizeTypesStandardD12V2 ... + VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2" + // VMSizeTypesStandardD12V2Promo ... + VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" + // VMSizeTypesStandardD13 ... + VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13" + // VMSizeTypesStandardD13V2 ... + VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2" + // VMSizeTypesStandardD13V2Promo ... + VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" + // VMSizeTypesStandardD14 ... + VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14" + // VMSizeTypesStandardD14V2 ... + VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2" + // VMSizeTypesStandardD14V2Promo ... + VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" + // VMSizeTypesStandardD15V2 ... + VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2" + // VMSizeTypesStandardD16sV3 ... + VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3" + // VMSizeTypesStandardD16V3 ... + VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3" + // VMSizeTypesStandardD1V2 ... + VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2" + // VMSizeTypesStandardD2 ... + VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2" + // VMSizeTypesStandardD2sV3 ... + VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3" + // VMSizeTypesStandardD2V2 ... + VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2" + // VMSizeTypesStandardD2V2Promo ... + VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" + // VMSizeTypesStandardD2V3 ... + VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3" + // VMSizeTypesStandardD3 ... + VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3" + // VMSizeTypesStandardD32sV3 ... + VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // VMSizeTypesStandardD32V3 ... + VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3" + // VMSizeTypesStandardD3V2 ... + VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2" + // VMSizeTypesStandardD3V2Promo ... + VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" + // VMSizeTypesStandardD4 ... + VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4" + // VMSizeTypesStandardD4sV3 ... + VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3" + // VMSizeTypesStandardD4V2 ... + VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2" + // VMSizeTypesStandardD4V2Promo ... + VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" + // VMSizeTypesStandardD4V3 ... + VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3" + // VMSizeTypesStandardD5V2 ... + VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2" + // VMSizeTypesStandardD5V2Promo ... + VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // VMSizeTypesStandardD64sV3 ... + VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // VMSizeTypesStandardD64V3 ... + VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3" + // VMSizeTypesStandardD8sV3 ... + VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3" + // VMSizeTypesStandardD8V3 ... + VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3" + // VMSizeTypesStandardDS1 ... + VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1" + // VMSizeTypesStandardDS11 ... + VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11" + // VMSizeTypesStandardDS11V2 ... + VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2" + // VMSizeTypesStandardDS11V2Promo ... + VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" + // VMSizeTypesStandardDS12 ... + VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12" + // VMSizeTypesStandardDS12V2 ... + VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2" + // VMSizeTypesStandardDS12V2Promo ... + VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" + // VMSizeTypesStandardDS13 ... + VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13" + // VMSizeTypesStandardDS132V2 ... + VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // VMSizeTypesStandardDS134V2 ... + VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" + // VMSizeTypesStandardDS13V2 ... + VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2" + // VMSizeTypesStandardDS13V2Promo ... + VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" + // VMSizeTypesStandardDS14 ... + VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14" + // VMSizeTypesStandardDS144V2 ... + VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // VMSizeTypesStandardDS148V2 ... + VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" + // VMSizeTypesStandardDS14V2 ... + VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2" + // VMSizeTypesStandardDS14V2Promo ... + VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" + // VMSizeTypesStandardDS15V2 ... + VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2" + // VMSizeTypesStandardDS1V2 ... + VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2" + // VMSizeTypesStandardDS2 ... + VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2" + // VMSizeTypesStandardDS2V2 ... + VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2" + // VMSizeTypesStandardDS2V2Promo ... + VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" + // VMSizeTypesStandardDS3 ... + VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3" + // VMSizeTypesStandardDS3V2 ... + VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2" + // VMSizeTypesStandardDS3V2Promo ... + VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" + // VMSizeTypesStandardDS4 ... + VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4" + // VMSizeTypesStandardDS4V2 ... + VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2" + // VMSizeTypesStandardDS4V2Promo ... + VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" + // VMSizeTypesStandardDS5V2 ... + VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2" + // VMSizeTypesStandardDS5V2Promo ... + VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" + // VMSizeTypesStandardE16sV3 ... + VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3" + // VMSizeTypesStandardE16V3 ... + VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3" + // VMSizeTypesStandardE2sV3 ... + VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3" + // VMSizeTypesStandardE2V3 ... + VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3" + // VMSizeTypesStandardE3216sV3 ... + VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // VMSizeTypesStandardE328sV3 ... + VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" + // VMSizeTypesStandardE32sV3 ... + VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3" + // VMSizeTypesStandardE32V3 ... + VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3" + // VMSizeTypesStandardE4sV3 ... + VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3" + // VMSizeTypesStandardE4V3 ... + VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3" + // VMSizeTypesStandardE6416sV3 ... + VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // VMSizeTypesStandardE6432sV3 ... + VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" + // VMSizeTypesStandardE64sV3 ... + VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3" + // VMSizeTypesStandardE64V3 ... + VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3" + // VMSizeTypesStandardE8sV3 ... + VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3" + // VMSizeTypesStandardE8V3 ... + VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3" + // VMSizeTypesStandardF1 ... + VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1" + // VMSizeTypesStandardF16 ... + VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16" + // VMSizeTypesStandardF16s ... + VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s" + // VMSizeTypesStandardF16sV2 ... + VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2" + // VMSizeTypesStandardF1s ... + VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s" + // VMSizeTypesStandardF2 ... + VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2" + // VMSizeTypesStandardF2s ... + VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s" + // VMSizeTypesStandardF2sV2 ... + VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // VMSizeTypesStandardF32sV2 ... + VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2" + // VMSizeTypesStandardF4 ... + VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4" + // VMSizeTypesStandardF4s ... + VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s" + // VMSizeTypesStandardF4sV2 ... + VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // VMSizeTypesStandardF64sV2 ... + VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // VMSizeTypesStandardF72sV2 ... + VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2" + // VMSizeTypesStandardF8 ... + VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8" + // VMSizeTypesStandardF8s ... + VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s" + // VMSizeTypesStandardF8sV2 ... + VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2" + // VMSizeTypesStandardG1 ... + VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1" + // VMSizeTypesStandardG2 ... + VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2" + // VMSizeTypesStandardG3 ... + VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3" + // VMSizeTypesStandardG4 ... + VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4" + // VMSizeTypesStandardG5 ... + VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5" + // VMSizeTypesStandardGS1 ... + VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1" + // VMSizeTypesStandardGS2 ... + VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2" + // VMSizeTypesStandardGS3 ... + VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3" + // VMSizeTypesStandardGS4 ... + VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4" + // VMSizeTypesStandardGS44 ... + VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4" + // VMSizeTypesStandardGS48 ... + VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8" + // VMSizeTypesStandardGS5 ... + VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5" + // VMSizeTypesStandardGS516 ... + VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16" + // VMSizeTypesStandardGS58 ... + VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8" + // VMSizeTypesStandardH16 ... + VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16" + // VMSizeTypesStandardH16m ... + VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m" + // VMSizeTypesStandardH16mr ... + VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr" + // VMSizeTypesStandardH16r ... + VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r" + // VMSizeTypesStandardH8 ... + VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8" + // VMSizeTypesStandardH8m ... + VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m" + // VMSizeTypesStandardL16s ... + VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s" + // VMSizeTypesStandardL32s ... + VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s" + // VMSizeTypesStandardL4s ... + VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s" + // VMSizeTypesStandardL8s ... + VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s" + // VMSizeTypesStandardM12832ms ... + VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // VMSizeTypesStandardM12864ms ... + VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // VMSizeTypesStandardM128ms ... + VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms" + // VMSizeTypesStandardM128s ... + VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s" + // VMSizeTypesStandardM6416ms ... + VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // VMSizeTypesStandardM6432ms ... + VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms" + // VMSizeTypesStandardM64ms ... + VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms" + // VMSizeTypesStandardM64s ... + VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s" + // VMSizeTypesStandardNC12 ... + VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12" + // VMSizeTypesStandardNC12sV2 ... + VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // VMSizeTypesStandardNC12sV3 ... + VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" + // VMSizeTypesStandardNC24 ... + VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24" + // VMSizeTypesStandardNC24r ... + VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r" + // VMSizeTypesStandardNC24rsV2 ... + VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // VMSizeTypesStandardNC24rsV3 ... + VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // VMSizeTypesStandardNC24sV2 ... + VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // VMSizeTypesStandardNC24sV3 ... + VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" + // VMSizeTypesStandardNC6 ... + VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6" + // VMSizeTypesStandardNC6sV2 ... + VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // VMSizeTypesStandardNC6sV3 ... + VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // VMSizeTypesStandardND12s ... + VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s" + // VMSizeTypesStandardND24rs ... + VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs" + // VMSizeTypesStandardND24s ... + VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s" + // VMSizeTypesStandardND6s ... + VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s" + // VMSizeTypesStandardNV12 ... + VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12" + // VMSizeTypesStandardNV24 ... + VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24" + // VMSizeTypesStandardNV6 ... + VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6" +) + +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6} +} + +// WeekDay enumerates the values for week day. +type WeekDay string + +const ( + // WeekDayFriday ... + WeekDayFriday WeekDay = "Friday" + // WeekDayMonday ... + WeekDayMonday WeekDay = "Monday" + // WeekDaySaturday ... + WeekDaySaturday WeekDay = "Saturday" + // WeekDaySunday ... + WeekDaySunday WeekDay = "Sunday" + // WeekDayThursday ... + WeekDayThursday WeekDay = "Thursday" + // WeekDayTuesday ... + WeekDayTuesday WeekDay = "Tuesday" + // WeekDayWednesday ... + WeekDayWednesday WeekDay = "Wednesday" +) + +// PossibleWeekDayValues returns an array of possible values for the WeekDay const type. +func PossibleWeekDayValues() []WeekDay { + return []WeekDay{WeekDayFriday, WeekDayMonday, WeekDaySaturday, WeekDaySunday, WeekDayThursday, WeekDayTuesday, WeekDayWednesday} +} + +// WorkloadRuntime enumerates the values for workload runtime. +type WorkloadRuntime string + +const ( + // WorkloadRuntimeOCIContainer Nodes will use Kubelet to run standard OCI container workloads. + WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" + // WorkloadRuntimeWasmWasi Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi" +) + +// PossibleWorkloadRuntimeValues returns an array of possible values for the WorkloadRuntime const type. +func PossibleWorkloadRuntimeValues() []WorkloadRuntime { + return []WorkloadRuntime{WorkloadRuntimeOCIContainer, WorkloadRuntimeWasmWasi} +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/maintenanceconfigurations.go b/services/containerservice/mgmt/2022-02-01/containerservice/maintenanceconfigurations.go new file mode 100644 index 000000000000..da7fd70e9a48 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/maintenanceconfigurations.go @@ -0,0 +1,440 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// MaintenanceConfigurationsClient is the the Container Service Client. +type MaintenanceConfigurationsClient struct { + BaseClient +} + +// NewMaintenanceConfigurationsClient creates an instance of the MaintenanceConfigurationsClient client. +func NewMaintenanceConfigurationsClient(subscriptionID string) MaintenanceConfigurationsClient { + return NewMaintenanceConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMaintenanceConfigurationsClientWithBaseURI creates an instance of the MaintenanceConfigurationsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewMaintenanceConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) MaintenanceConfigurationsClient { + return MaintenanceConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// configName - the name of the maintenance configuration. +// parameters - the maintenance configuration to create or update. +func (client MaintenanceConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration) (result MaintenanceConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, configName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client MaintenanceConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configName": autorest.Encode("path", configName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client MaintenanceConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client MaintenanceConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result MaintenanceConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// configName - the name of the maintenance configuration. +func (client MaintenanceConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, configName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, configName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MaintenanceConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, configName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configName": autorest.Encode("path", configName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client MaintenanceConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MaintenanceConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// configName - the name of the maintenance configuration. +func (client MaintenanceConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, configName string) (result MaintenanceConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, configName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client MaintenanceConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, configName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configName": autorest.Encode("path", configName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client MaintenanceConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MaintenanceConfigurationsClient) GetResponder(resp *http.Response) (result MaintenanceConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByManagedCluster sends the list by managed cluster request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, resourceGroupName string, resourceName string) (result MaintenanceConfigurationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.ListByManagedCluster") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", err.Error()) + } + + result.fn = client.listByManagedClusterNextResults + req, err := client.ListByManagedClusterPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByManagedClusterSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListByManagedClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByManagedClusterPreparer prepares the ListByManagedCluster request. +func (client MaintenanceConfigurationsClient) ListByManagedClusterPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByManagedClusterSender sends the ListByManagedCluster request. The method will close the +// http.Response Body if it receives an error. +func (client MaintenanceConfigurationsClient) ListByManagedClusterSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByManagedClusterResponder handles the response to the ListByManagedCluster request. The method always +// closes the http.Response Body. +func (client MaintenanceConfigurationsClient) ListByManagedClusterResponder(resp *http.Response) (result MaintenanceConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByManagedClusterNextResults retrieves the next set of results, if any. +func (client MaintenanceConfigurationsClient) listByManagedClusterNextResults(ctx context.Context, lastResults MaintenanceConfigurationListResult) (result MaintenanceConfigurationListResult, err error) { + req, err := lastResults.maintenanceConfigurationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "listByManagedClusterNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByManagedClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "listByManagedClusterNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByManagedClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "listByManagedClusterNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByManagedClusterComplete enumerates all values, automatically crossing page boundaries as required. +func (client MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, resourceGroupName string, resourceName string) (result MaintenanceConfigurationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.ListByManagedCluster") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByManagedCluster(ctx, resourceGroupName, resourceName) + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/managedclusters.go b/services/containerservice/mgmt/2022-02-01/containerservice/managedclusters.go new file mode 100644 index 000000000000..952e0fae5483 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/managedclusters.go @@ -0,0 +1,2043 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagedClustersClient is the the Container Service Client. +type ManagedClustersClient struct { + BaseClient +} + +// NewManagedClustersClient creates an instance of the ManagedClustersClient client. +func NewManagedClustersClient(subscriptionID string) ManagedClustersClient { + return NewManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedClustersClientWithBaseURI creates an instance of the ManagedClustersClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) ManagedClustersClient { + return ManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - the managed cluster to create or update. +func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (result ManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Pattern, Rule: `^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.CountIPv6", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.CountIPv6", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.CountIPv6", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMaximum, Rule: int64(120), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMinimum, Rule: int64(4), Chain: nil}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.ManagedOutboundIPProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.ManagedOutboundIPProfile.Count", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.ManagedOutboundIPProfile.Count", Name: validation.InclusiveMaximum, Rule: int64(16), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.ManagedOutboundIPProfile.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.IdleTimeoutInMinutes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMaximum, Rule: int64(120), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.NatGatewayProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMinimum, Rule: int64(4), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future ManagedClustersCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagedClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) DeleteSender(req *http.Request) (future ManagedClustersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAccessProfile **WARNING**: This API will be deprecated. Instead use +// [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or +// [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// roleName - the name of the role for managed cluster accessProfile resource. +func (client ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result ManagedClusterAccessProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetAccessProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetAccessProfile", err.Error()) + } + + req, err := client.GetAccessProfilePreparer(ctx, resourceGroupName, resourceName, roleName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetAccessProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure sending request") + return + } + + result, err = client.GetAccessProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure responding to request") + return + } + + return +} + +// GetAccessProfilePreparer prepares the GetAccessProfile request. +func (client ManagedClustersClient) GetAccessProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "roleName": autorest.Encode("path", roleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAccessProfileSender sends the GetAccessProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetAccessProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAccessProfileResponder handles the response to the GetAccessProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetAccessProfileResponder(resp *http.Response) (result ManagedClusterAccessProfile, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCommandResult sends the get command result request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// commandID - id of the command. +func (client ManagedClustersClient) GetCommandResult(ctx context.Context, resourceGroupName string, resourceName string, commandID string) (result RunCommandResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetCommandResult") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetCommandResult", err.Error()) + } + + req, err := client.GetCommandResultPreparer(ctx, resourceGroupName, resourceName, commandID) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetCommandResult", nil, "Failure preparing request") + return + } + + resp, err := client.GetCommandResultSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetCommandResult", resp, "Failure sending request") + return + } + + result, err = client.GetCommandResultResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetCommandResult", resp, "Failure responding to request") + return + } + + return +} + +// GetCommandResultPreparer prepares the GetCommandResult request. +func (client ManagedClustersClient) GetCommandResultPreparer(ctx context.Context, resourceGroupName string, resourceName string, commandID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "commandId": autorest.Encode("path", commandID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCommandResultSender sends the GetCommandResult request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetCommandResultSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCommandResultResponder handles the response to the GetCommandResult request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetCommandResultResponder(resp *http.Response) (result RunCommandResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOSOptions sends the get os options request. +// Parameters: +// location - the name of Azure region. +// resourceType - the resource type for which the OS options needs to be returned +func (client ManagedClustersClient) GetOSOptions(ctx context.Context, location string, resourceType string) (result OSOptionProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetOSOptions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetOSOptions", err.Error()) + } + + req, err := client.GetOSOptionsPreparer(ctx, location, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetOSOptions", nil, "Failure preparing request") + return + } + + resp, err := client.GetOSOptionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetOSOptions", resp, "Failure sending request") + return + } + + result, err = client.GetOSOptionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetOSOptions", resp, "Failure responding to request") + return + } + + return +} + +// GetOSOptionsPreparer prepares the GetOSOptions request. +func (client ManagedClustersClient) GetOSOptionsPreparer(ctx context.Context, location string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(resourceType) > 0 { + queryParameters["resource-type"] = autorest.Encode("query", resourceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOSOptionsSender sends the GetOSOptions request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetOSOptionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOSOptionsResponder handles the response to the GetOSOptions request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetOSOptionsResponder(resp *http.Response) (result OSOptionProfile, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile sends the get upgrade profile request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClusterUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure responding to request") + return + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client ManagedClustersClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetUpgradeProfileResponder(resp *http.Response) (result ManagedClusterUpgradeProfile, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client ManagedClustersClient) List(ctx context.Context) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListComplete(ctx context.Context) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup sends the list by resource group request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client ManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ManagedClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListClusterAdminCredentials sends the list cluster admin credentials request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// serverFqdn - server fqdn type for credentials to be returned +func (client ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterAdminCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterAdminCredentials", err.Error()) + } + + req, err := client.ListClusterAdminCredentialsPreparer(ctx, resourceGroupName, resourceName, serverFqdn) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterAdminCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterAdminCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure responding to request") + return + } + + return +} + +// ListClusterAdminCredentialsPreparer prepares the ListClusterAdminCredentials request. +func (client ManagedClustersClient) ListClusterAdminCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serverFqdn) > 0 { + queryParameters["server-fqdn"] = autorest.Encode("query", serverFqdn) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterAdminCredentialsSender sends the ListClusterAdminCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterAdminCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListClusterAdminCredentialsResponder handles the response to the ListClusterAdminCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterAdminCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListClusterMonitoringUserCredentials sends the list cluster monitoring user credentials request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// serverFqdn - server fqdn type for credentials to be returned +func (client ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterMonitoringUserCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", err.Error()) + } + + req, err := client.ListClusterMonitoringUserCredentialsPreparer(ctx, resourceGroupName, resourceName, serverFqdn) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterMonitoringUserCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterMonitoringUserCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure responding to request") + return + } + + return +} + +// ListClusterMonitoringUserCredentialsPreparer prepares the ListClusterMonitoringUserCredentials request. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serverFqdn) > 0 { + queryParameters["server-fqdn"] = autorest.Encode("query", serverFqdn) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterMonitoringUserCredentialsSender sends the ListClusterMonitoringUserCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListClusterMonitoringUserCredentialsResponder handles the response to the ListClusterMonitoringUserCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListClusterUserCredentials sends the list cluster user credentials request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// serverFqdn - server fqdn type for credentials to be returned +// formatParameter - only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' +// will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires +// kubelogin binary in the path. +func (client ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string, formatParameter Format) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterUserCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterUserCredentials", err.Error()) + } + + req, err := client.ListClusterUserCredentialsPreparer(ctx, resourceGroupName, resourceName, serverFqdn, formatParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterUserCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterUserCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure responding to request") + return + } + + return +} + +// ListClusterUserCredentialsPreparer prepares the ListClusterUserCredentials request. +func (client ManagedClustersClient) ListClusterUserCredentialsPreparer(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string, formatParameter Format) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(serverFqdn) > 0 { + queryParameters["server-fqdn"] = autorest.Encode("query", serverFqdn) + } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterUserCredentialsSender sends the ListClusterUserCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterUserCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListClusterUserCredentialsResponder handles the response to the ListClusterUserCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOutboundNetworkDependenciesEndpoints gets a list of egress endpoints (network endpoints of all outbound +// dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, resourceName string) (result OutboundEnvironmentEndpointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.oeec.Response.Response != nil { + sc = result.oeec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", err.Error()) + } + + result.fn = client.listOutboundNetworkDependenciesEndpointsNextResults + req, err := client.ListOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.oeec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result.oeec, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + if result.oeec.hasNextLink() && result.oeec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOutboundNetworkDependenciesEndpointsPreparer prepares the ListOutboundNetworkDependenciesEndpoints request. +func (client ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOutboundNetworkDependenciesEndpointsSender sends the ListOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOutboundNetworkDependenciesEndpointsResponder handles the response to the ListOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundEnvironmentEndpointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client ManagedClustersClient) listOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundEnvironmentEndpointCollection) (result OutboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.outboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, resourceName string) (result OutboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, resourceName) + return +} + +// ResetAADProfile sends the reset aad profile request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - the AAD profile to set on the Managed Cluster +func (client ManagedClustersClient) ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (result ManagedClustersResetAADProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetAADProfile") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetAADProfile", err.Error()) + } + + req, err := client.ResetAADProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetAADProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetAADProfilePreparer prepares the ResetAADProfile request. +func (client ManagedClustersClient) ResetAADProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAADProfileSender sends the ResetAADProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetAADProfileSender(req *http.Request) (future ManagedClustersResetAADProfileFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResetAADProfileResponder handles the response to the ResetAADProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetAADProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetServicePrincipalProfile this action cannot be performed on a cluster that is not using a service principal +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - the service principal profile to set on the managed cluster. +func (client ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (result ManagedClustersResetServicePrincipalProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetServicePrincipalProfile") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", err.Error()) + } + + req, err := client.ResetServicePrincipalProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetServicePrincipalProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetServicePrincipalProfilePreparer prepares the ResetServicePrincipalProfile request. +func (client ManagedClustersClient) ResetServicePrincipalProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetServicePrincipalProfileSender sends the ResetServicePrincipalProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetServicePrincipalProfileSender(req *http.Request) (future ManagedClustersResetServicePrincipalProfileFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResetServicePrincipalProfileResponder handles the response to the ResetServicePrincipalProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetServicePrincipalProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RotateClusterCertificates see [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for +// more details about rotating managed cluster certificates. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersRotateClusterCertificatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RotateClusterCertificates") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "RotateClusterCertificates", err.Error()) + } + + req, err := client.RotateClusterCertificatesPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") + return + } + + result, err = client.RotateClusterCertificatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", result.Response(), "Failure sending request") + return + } + + return +} + +// RotateClusterCertificatesPreparer prepares the RotateClusterCertificates request. +func (client ManagedClustersClient) RotateClusterCertificatesPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RotateClusterCertificatesSender sends the RotateClusterCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Request) (future ManagedClustersRotateClusterCertificatesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RotateClusterCertificatesResponder handles the response to the RotateClusterCertificates request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) RotateClusterCertificatesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RunCommand AKS will create a pod to run the command. This is primarily useful for private clusters. For more +// information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// requestPayload - the run command request +func (client ManagedClustersClient) RunCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest) (result ManagedClustersRunCommandFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RunCommand") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: requestPayload, + Constraints: []validation.Constraint{{Target: "requestPayload.Command", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "RunCommand", err.Error()) + } + + req, err := client.RunCommandPreparer(ctx, resourceGroupName, resourceName, requestPayload) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RunCommand", nil, "Failure preparing request") + return + } + + result, err = client.RunCommandSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RunCommand", result.Response(), "Failure sending request") + return + } + + return +} + +// RunCommandPreparer prepares the RunCommand request. +func (client ManagedClustersClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", pathParameters), + autorest.WithJSON(requestPayload), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RunCommandSender sends the RunCommand request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) RunCommandSender(req *http.Request) (future ManagedClustersRunCommandFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RunCommandResponder handles the response to the RunCommand request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Start see [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about +// starting a cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Start(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client ManagedClustersClient) StartPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) StartSender(req *http.Request) (future ManagedClustersStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop this can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the +// control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue +// charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for +// more details about stopping a cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Stop(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.Stop") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client ManagedClustersClient) StopPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) StopSender(req *http.Request) (future ManagedClustersStopFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateTags sends the update tags request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Update Managed Cluster Tags operation. +func (client ManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result ManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.UpdateTags") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client ManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) UpdateTagsSender(req *http.Request) (future ManagedClustersUpdateTagsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/models.go b/services/containerservice/mgmt/2022-02-01/containerservice/models.go new file mode 100644 index 000000000000..0f20725690f8 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/models.go @@ -0,0 +1,4007 @@ +package containerservice + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice" + +// AccessProfile profile for enabling a user to access a managed cluster. +type AccessProfile struct { + // KubeConfig - Base64-encoded Kubernetes configuration file. + KubeConfig *[]byte `json:"kubeConfig,omitempty"` +} + +// AgentPool agent Pool. +type AgentPool struct { + autorest.Response `json:"-"` + // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. + *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPool. +func (ap AgentPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.ManagedClusterAgentPoolProfileProperties != nil { + objectMap["properties"] = ap.ManagedClusterAgentPoolProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPool struct. +func (ap *AgentPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties + err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) + if err != nil { + return err + } + ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ap.Type = &typeVar + } + } + } + + return nil +} + +// AgentPoolAvailableVersions the list of available versions for an agent pool. +type AgentPoolAvailableVersions struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The ID of the agent pool version list. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the agent pool version list. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool version list. + Type *string `json:"type,omitempty"` + // AgentPoolAvailableVersionsProperties - Properties of agent pool available versions. + *AgentPoolAvailableVersionsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolAvailableVersions. +func (apav AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apav.AgentPoolAvailableVersionsProperties != nil { + objectMap["properties"] = apav.AgentPoolAvailableVersionsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolAvailableVersions struct. +func (apav *AgentPoolAvailableVersions) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apav.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apav.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apav.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolAvailableVersionsProperties AgentPoolAvailableVersionsProperties + err = json.Unmarshal(*v, &agentPoolAvailableVersionsProperties) + if err != nil { + return err + } + apav.AgentPoolAvailableVersionsProperties = &agentPoolAvailableVersionsProperties + } + } + } + + return nil +} + +// AgentPoolAvailableVersionsProperties the list of available agent pool versions. +type AgentPoolAvailableVersionsProperties struct { + // AgentPoolVersions - List of versions available for agent pool. + AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"` +} + +// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem ... +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { + // Default - Whether this version is the default agent pool version. + Default *bool `json:"default,omitempty"` + // KubernetesVersion - The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// AgentPoolListResult the response from the List Agent Pools operation. +type AgentPoolListResult struct { + autorest.Response `json:"-"` + // Value - The list of agent pools. + Value *[]AgentPool `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of agent pool results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolListResult. +func (aplr AgentPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aplr.Value != nil { + objectMap["value"] = aplr.Value + } + return json.Marshal(objectMap) +} + +// AgentPoolListResultIterator provides access to a complete listing of AgentPool values. +type AgentPoolListResultIterator struct { + i int + page AgentPoolListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AgentPoolListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AgentPoolListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AgentPoolListResultIterator) Response() AgentPoolListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AgentPoolListResultIterator) Value() AgentPool { + if !iter.page.NotDone() { + return AgentPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AgentPoolListResultIterator type. +func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator { + return AgentPoolListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aplr AgentPoolListResult) IsEmpty() bool { + return aplr.Value == nil || len(*aplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (aplr AgentPoolListResult) hasNextLink() bool { + return aplr.NextLink != nil && len(*aplr.NextLink) != 0 +} + +// agentPoolListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) { + if !aplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aplr.NextLink))) +} + +// AgentPoolListResultPage contains a page of AgentPool values. +type AgentPoolListResultPage struct { + fn func(context.Context, AgentPoolListResult) (AgentPoolListResult, error) + aplr AgentPoolListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.aplr) + if err != nil { + return err + } + page.aplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AgentPoolListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AgentPoolListResultPage) NotDone() bool { + return !page.aplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AgentPoolListResultPage) Response() AgentPoolListResult { + return page.aplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AgentPoolListResultPage) Values() []AgentPool { + if page.aplr.IsEmpty() { + return nil + } + return *page.aplr.Value +} + +// Creates a new instance of the AgentPoolListResultPage type. +func NewAgentPoolListResultPage(cur AgentPoolListResult, getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return AgentPoolListResultPage{ + fn: getNextPage, + aplr: cur, + } +} + +// AgentPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AgentPoolsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (AgentPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsCreateOrUpdateFuture.Result. +func (future *AgentPoolsCreateOrUpdateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ap.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent { + ap, err = client.CreateOrUpdateResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", ap.Response.Response, "Failure responding to request") + } + } + return +} + +// AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AgentPoolsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsDeleteFuture.Result. +func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AgentPoolsUpgradeNodeImageVersionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AgentPoolsUpgradeNodeImageVersionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (AgentPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsUpgradeNodeImageVersionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsUpgradeNodeImageVersionFuture.Result. +func (future *AgentPoolsUpgradeNodeImageVersionFuture) result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsUpgradeNodeImageVersionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ap.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsUpgradeNodeImageVersionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent { + ap, err = client.UpgradeNodeImageVersionResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsUpgradeNodeImageVersionFuture", "Result", ap.Response.Response, "Failure responding to request") + } + } + return +} + +// AgentPoolUpgradeProfile the list of available upgrades for an agent pool. +type AgentPoolUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The ID of the agent pool upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the agent pool upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the agent pool upgrade profile. + Type *string `json:"type,omitempty"` + // AgentPoolUpgradeProfileProperties - The properties of the agent pool upgrade profile. + *AgentPoolUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolUpgradeProfile. +func (apup AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apup.AgentPoolUpgradeProfileProperties != nil { + objectMap["properties"] = apup.AgentPoolUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolUpgradeProfile struct. +func (apup *AgentPoolUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apup.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolUpgradeProfileProperties AgentPoolUpgradeProfileProperties + err = json.Unmarshal(*v, &agentPoolUpgradeProfileProperties) + if err != nil { + return err + } + apup.AgentPoolUpgradeProfileProperties = &agentPoolUpgradeProfileProperties + } + } + } + + return nil +} + +// AgentPoolUpgradeProfileProperties the list of available upgrade versions. +type AgentPoolUpgradeProfileProperties struct { + // KubernetesVersion - The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"` + // LatestNodeImageVersion - The latest AKS supported node image version. + LatestNodeImageVersion *string `json:"latestNodeImageVersion,omitempty"` +} + +// AgentPoolUpgradeProfilePropertiesUpgradesItem ... +type AgentPoolUpgradeProfilePropertiesUpgradesItem struct { + // KubernetesVersion - The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether the Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// AgentPoolUpgradeSettings settings for upgrading an agentpool +type AgentPoolUpgradeSettings struct { + // MaxSurge - This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + MaxSurge *string `json:"maxSurge,omitempty"` +} + +// CloudError an error response from the Container service. +type CloudError struct { + // Error - Details about the error. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Container service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// CommandResultProperties the results of a run command +type CommandResultProperties struct { + // ProvisioningState - READ-ONLY; provisioning State + ProvisioningState *string `json:"provisioningState,omitempty"` + // ExitCode - READ-ONLY; The exit code of the command + ExitCode *int32 `json:"exitCode,omitempty"` + // StartedAt - READ-ONLY; The time when the command started. + StartedAt *date.Time `json:"startedAt,omitempty"` + // FinishedAt - READ-ONLY; The time when the command finished. + FinishedAt *date.Time `json:"finishedAt,omitempty"` + // Logs - READ-ONLY; The command output. + Logs *string `json:"logs,omitempty"` + // Reason - READ-ONLY; An explanation of why provisioningState is set to failed (if so). + Reason *string `json:"reason,omitempty"` +} + +// MarshalJSON is the custom marshaler for CommandResultProperties. +func (crp CommandResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CreationData data used when creating a target resource from a source resource. +type CreationData struct { + // SourceResourceID - This is the ARM ID of the source object to be used to create the target object. + SourceResourceID *string `json:"sourceResourceId,omitempty"` +} + +// CredentialResult the credential result response. +type CredentialResult struct { + // Name - READ-ONLY; The name of the credential. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; Base64-encoded Kubernetes configuration file. + Value *[]byte `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialResult. +func (cr CredentialResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CredentialResults the list credential result response. +type CredentialResults struct { + autorest.Response `json:"-"` + // Kubeconfigs - READ-ONLY; Base64-encoded Kubernetes configuration file. + Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialResults. +func (cr CredentialResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DiagnosticsProfile profile for diagnostics on the container service cluster. +type DiagnosticsProfile struct { + // VMDiagnostics - Profile for diagnostics on the container service VMs. + VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// EndpointDependency a domain name that AKS agent nodes are reaching at. +type EndpointDependency struct { + // DomainName - The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + // EndpointDetails - The Ports and Protocols used when connecting to domainName. + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} + +// EndpointDetail connect information from the AKS agent nodes to a single endpoint. +type EndpointDetail struct { + // IPAddress - An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + // Port - The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` + // Protocol - The protocol used for connection + Protocol *string `json:"protocol,omitempty"` + // Description - Description of the detail + Description *string `json:"description,omitempty"` +} + +// ExtendedLocation the complex type of the extended location. +type ExtendedLocation struct { + // Name - The name of the extended location. + Name *string `json:"name,omitempty"` + // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' + Type ExtendedLocationTypes `json:"type,omitempty"` +} + +// KubeletConfig see [AKS custom node +// configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. +type KubeletConfig struct { + // CPUManagerPolicy - The default is 'none'. See [Kubernetes CPU management policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) for more information. Allowed values are 'none' and 'static'. + CPUManagerPolicy *string `json:"cpuManagerPolicy,omitempty"` + // CPUCfsQuota - The default is true. + CPUCfsQuota *bool `json:"cpuCfsQuota,omitempty"` + // CPUCfsQuotaPeriod - The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + CPUCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"` + // ImageGcHighThreshold - To disable image garbage collection, set to 100. The default is 85% + ImageGcHighThreshold *int32 `json:"imageGcHighThreshold,omitempty"` + // ImageGcLowThreshold - This cannot be set higher than imageGcHighThreshold. The default is 80% + ImageGcLowThreshold *int32 `json:"imageGcLowThreshold,omitempty"` + // TopologyManagerPolicy - For more information see [Kubernetes Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"` + // AllowedUnsafeSysctls - Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + AllowedUnsafeSysctls *[]string `json:"allowedUnsafeSysctls,omitempty"` + // FailSwapOn - If set to true it will make the Kubelet fail to start if swap is enabled on the node. + FailSwapOn *bool `json:"failSwapOn,omitempty"` + // ContainerLogMaxSizeMB - The maximum size (e.g. 10Mi) of container log file before it is rotated. + ContainerLogMaxSizeMB *int32 `json:"containerLogMaxSizeMB,omitempty"` + // ContainerLogMaxFiles - The maximum number of container log files that can be present for a container. The number must be ≥ 2. + ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty"` + // PodMaxPids - The maximum number of processes per pod. + PodMaxPids *int32 `json:"podMaxPids,omitempty"` +} + +// LinuxOSConfig see [AKS custom node +// configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. +type LinuxOSConfig struct { + // Sysctls - Sysctl settings for Linux agent nodes. + Sysctls *SysctlConfig `json:"sysctls,omitempty"` + // TransparentHugePageEnabled - Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"` + // TransparentHugePageDefrag - Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see [Transparent Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"` + // SwapFileSizeMB - The size in MB of a swap file that will be created on each node. + SwapFileSizeMB *int32 `json:"swapFileSizeMB,omitempty"` +} + +// LinuxProfile profile for Linux VMs in the container service cluster. +type LinuxProfile struct { + // AdminUsername - The administrator username to use for Linux VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // SSH - The SSH configuration for Linux-based VMs running on Azure. + SSH *SSHConfiguration `json:"ssh,omitempty"` +} + +// MaintenanceConfiguration see [planned +// maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about +// planned maintenance. +type MaintenanceConfiguration struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; The system metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // MaintenanceConfigurationProperties - Properties of a default maintenance configuration. + *MaintenanceConfigurationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MaintenanceConfiguration. +func (mc MaintenanceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.MaintenanceConfigurationProperties != nil { + objectMap["properties"] = mc.MaintenanceConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MaintenanceConfiguration struct. +func (mc *MaintenanceConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mc.SystemData = &systemData + } + case "properties": + if v != nil { + var maintenanceConfigurationProperties MaintenanceConfigurationProperties + err = json.Unmarshal(*v, &maintenanceConfigurationProperties) + if err != nil { + return err + } + mc.MaintenanceConfigurationProperties = &maintenanceConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + } + } + + return nil +} + +// MaintenanceConfigurationListResult the response from the List maintenance configurations operation. +type MaintenanceConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - The list of maintenance configurations. + Value *[]MaintenanceConfiguration `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of maintenance configuration results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for MaintenanceConfigurationListResult. +func (mclr MaintenanceConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mclr.Value != nil { + objectMap["value"] = mclr.Value + } + return json.Marshal(objectMap) +} + +// MaintenanceConfigurationListResultIterator provides access to a complete listing of +// MaintenanceConfiguration values. +type MaintenanceConfigurationListResultIterator struct { + i int + page MaintenanceConfigurationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *MaintenanceConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *MaintenanceConfigurationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter MaintenanceConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter MaintenanceConfigurationListResultIterator) Response() MaintenanceConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter MaintenanceConfigurationListResultIterator) Value() MaintenanceConfiguration { + if !iter.page.NotDone() { + return MaintenanceConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the MaintenanceConfigurationListResultIterator type. +func NewMaintenanceConfigurationListResultIterator(page MaintenanceConfigurationListResultPage) MaintenanceConfigurationListResultIterator { + return MaintenanceConfigurationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr MaintenanceConfigurationListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mclr MaintenanceConfigurationListResult) hasNextLink() bool { + return mclr.NextLink != nil && len(*mclr.NextLink) != 0 +} + +// maintenanceConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr MaintenanceConfigurationListResult) maintenanceConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !mclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// MaintenanceConfigurationListResultPage contains a page of MaintenanceConfiguration values. +type MaintenanceConfigurationListResultPage struct { + fn func(context.Context, MaintenanceConfigurationListResult) (MaintenanceConfigurationListResult, error) + mclr MaintenanceConfigurationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *MaintenanceConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *MaintenanceConfigurationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page MaintenanceConfigurationListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page MaintenanceConfigurationListResultPage) Response() MaintenanceConfigurationListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page MaintenanceConfigurationListResultPage) Values() []MaintenanceConfiguration { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// Creates a new instance of the MaintenanceConfigurationListResultPage type. +func NewMaintenanceConfigurationListResultPage(cur MaintenanceConfigurationListResult, getNextPage func(context.Context, MaintenanceConfigurationListResult) (MaintenanceConfigurationListResult, error)) MaintenanceConfigurationListResultPage { + return MaintenanceConfigurationListResultPage{ + fn: getNextPage, + mclr: cur, + } +} + +// MaintenanceConfigurationProperties properties used to configure planned maintenance for a Managed +// Cluster. +type MaintenanceConfigurationProperties struct { + // TimeInWeek - If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + TimeInWeek *[]TimeInWeek `json:"timeInWeek,omitempty"` + // NotAllowedTime - Time slots on which upgrade is not allowed. + NotAllowedTime *[]TimeSpan `json:"notAllowedTime,omitempty"` +} + +// ManagedCluster managed cluster. +type ManagedCluster struct { + autorest.Response `json:"-"` + // Sku - The managed cluster SKU. + Sku *ManagedClusterSKU `json:"sku,omitempty"` + // ExtendedLocation - The extended location of the Virtual Machine. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // Identity - The identity of the managed cluster, if configured. + Identity *ManagedClusterIdentity `json:"identity,omitempty"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedCluster. +func (mc ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.Sku != nil { + objectMap["sku"] = mc.Sku + } + if mc.ExtendedLocation != nil { + objectMap["extendedLocation"] = mc.ExtendedLocation + } + if mc.Identity != nil { + objectMap["identity"] = mc.Identity + } + if mc.ManagedClusterProperties != nil { + objectMap["properties"] = mc.ManagedClusterProperties + } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. +func (mc *ManagedCluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku ManagedClusterSKU + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + mc.Sku = &sku + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + mc.ExtendedLocation = &extendedLocation + } + case "identity": + if v != nil { + var identity ManagedClusterIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mc.Identity = &identity + } + case "properties": + if v != nil { + var managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mc.SystemData = &systemData + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mc.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAADProfile for more details see [managed AAD on +// AKS](https://docs.microsoft.com/azure/aks/managed-aad). +type ManagedClusterAADProfile struct { + // Managed - Whether to enable managed AAD. + Managed *bool `json:"managed,omitempty"` + // EnableAzureRBAC - Whether to enable Azure RBAC for Kubernetes authorization. + EnableAzureRBAC *bool `json:"enableAzureRBAC,omitempty"` + // AdminGroupObjectIDs - The list of AAD group object IDs that will have admin role of the cluster. + AdminGroupObjectIDs *[]string `json:"adminGroupObjectIDs,omitempty"` + // ClientAppID - The client AAD application ID. + ClientAppID *string `json:"clientAppID,omitempty"` + // ServerAppID - The server AAD application ID. + ServerAppID *string `json:"serverAppID,omitempty"` + // ServerAppSecret - The server AAD application secret. + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + // TenantID - The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + TenantID *string `json:"tenantID,omitempty"` +} + +// ManagedClusterAccessProfile managed cluster Access Profile. +type ManagedClusterAccessProfile struct { + autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. +func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile + } + if mcap.Location != nil { + objectMap["location"] = mcap.Location + } + if mcap.Tags != nil { + objectMap["tags"] = mcap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. +func (mcap *ManagedClusterAccessProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcap.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mcap.SystemData = &systemData + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcap.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAddonProfile a Kubernetes add-on profile for a managed cluster. +type ManagedClusterAddonProfile struct { + // Enabled - Whether the add-on is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Config - Key-value pairs for configuring an add-on. + Config map[string]*string `json:"config"` + // Identity - READ-ONLY; Information of user assigned identity used by this add-on. + Identity *ManagedClusterAddonProfileIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. +func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.Enabled != nil { + objectMap["enabled"] = mcap.Enabled + } + if mcap.Config != nil { + objectMap["config"] = mcap.Config + } + return json.Marshal(objectMap) +} + +// ManagedClusterAddonProfileIdentity information of user assigned identity used by this add-on. +type ManagedClusterAddonProfileIdentity struct { + // ResourceID - The resource ID of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client ID of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object ID of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + +// ManagedClusterAgentPoolProfile profile for the container service agent pool. +type ManagedClusterAgentPoolProfile struct { + // Name - Windows agent pool names must be 6 characters or less. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + VMSize *string `json:"vmSize,omitempty"` + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // OsDiskType - Possible values include: 'OSDiskTypeManaged', 'OSDiskTypeEphemeral' + OsDiskType OSDiskType `json:"osDiskType,omitempty"` + // KubeletDiskType - Possible values include: 'KubeletDiskTypeOS', 'KubeletDiskTypeTemporary' + KubeletDiskType KubeletDiskType `json:"kubeletDiskType,omitempty"` + // WorkloadRuntime - Possible values include: 'WorkloadRuntimeOCIContainer', 'WorkloadRuntimeWasmWasi' + WorkloadRuntime WorkloadRuntime `json:"workloadRuntime,omitempty"` + // VnetSubnetID - If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // PodSubnetID - If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + PodSubnetID *string `json:"podSubnetID,omitempty"` + // MaxPods - The maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows' + OsType OSType `json:"osType,omitempty"` + // OsSKU - Possible values include: 'OSSKUUbuntu', 'OSSKUCBLMariner' + OsSKU OSSKU `json:"osSKU,omitempty"` + // MaxCount - The maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - The minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // ScaleDownMode - This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: 'ScaleDownModeDelete', 'ScaleDownModeDeallocate' + ScaleDownMode ScaleDownMode `json:"scaleDownMode,omitempty"` + // Type - Possible values include: 'AgentPoolTypeVirtualMachineScaleSets', 'AgentPoolTypeAvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // Mode - Possible values include: 'AgentPoolModeSystem', 'AgentPoolModeUser' + Mode AgentPoolMode `json:"mode,omitempty"` + // OrchestratorVersion - As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // NodeImageVersion - READ-ONLY; The version of node image + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + // UpgradeSettings - Settings for upgrading the agentpool + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // PowerState - When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded + PowerState *PowerState `json:"powerState,omitempty"` + // AvailabilityZones - The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // NodePublicIPPrefixID - This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` + // ScaleSetPriority - The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Possible values include: 'ScaleSetPrioritySpot', 'ScaleSetPriorityRegular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: 'ScaleSetEvictionPolicyDelete', 'ScaleSetEvictionPolicyDeallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // SpotMaxPrice - Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` + // Tags - The tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags"` + // NodeLabels - The node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels"` + // NodeTaints - The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` + // ProximityPlacementGroupID - The ID for Proximity Placement Group. + ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"` + // KubeletConfig - The Kubelet configuration on the agent pool nodes. + KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` + // LinuxOSConfig - The OS configuration of Linux agent nodes. + LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` + // EnableEncryptionAtHost - This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` + // EnableUltraSSD - Whether to enable UltraSSD + EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` + // EnableFIPS - See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + EnableFIPS *bool `json:"enableFIPS,omitempty"` + // GpuInstanceProfile - GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: 'GPUInstanceProfileMIG1g', 'GPUInstanceProfileMIG2g', 'GPUInstanceProfileMIG3g', 'GPUInstanceProfileMIG4g', 'GPUInstanceProfileMIG7g' + GpuInstanceProfile GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + // CreationData - CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + CreationData *CreationData `json:"creationData,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfile. +func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcapp.Name != nil { + objectMap["name"] = mcapp.Name + } + if mcapp.Count != nil { + objectMap["count"] = mcapp.Count + } + if mcapp.VMSize != nil { + objectMap["vmSize"] = mcapp.VMSize + } + if mcapp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mcapp.OsDiskSizeGB + } + if mcapp.OsDiskType != "" { + objectMap["osDiskType"] = mcapp.OsDiskType + } + if mcapp.KubeletDiskType != "" { + objectMap["kubeletDiskType"] = mcapp.KubeletDiskType + } + if mcapp.WorkloadRuntime != "" { + objectMap["workloadRuntime"] = mcapp.WorkloadRuntime + } + if mcapp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mcapp.VnetSubnetID + } + if mcapp.PodSubnetID != nil { + objectMap["podSubnetID"] = mcapp.PodSubnetID + } + if mcapp.MaxPods != nil { + objectMap["maxPods"] = mcapp.MaxPods + } + if mcapp.OsType != "" { + objectMap["osType"] = mcapp.OsType + } + if mcapp.OsSKU != "" { + objectMap["osSKU"] = mcapp.OsSKU + } + if mcapp.MaxCount != nil { + objectMap["maxCount"] = mcapp.MaxCount + } + if mcapp.MinCount != nil { + objectMap["minCount"] = mcapp.MinCount + } + if mcapp.EnableAutoScaling != nil { + objectMap["enableAutoScaling"] = mcapp.EnableAutoScaling + } + if mcapp.ScaleDownMode != "" { + objectMap["scaleDownMode"] = mcapp.ScaleDownMode + } + if mcapp.Type != "" { + objectMap["type"] = mcapp.Type + } + if mcapp.Mode != "" { + objectMap["mode"] = mcapp.Mode + } + if mcapp.OrchestratorVersion != nil { + objectMap["orchestratorVersion"] = mcapp.OrchestratorVersion + } + if mcapp.UpgradeSettings != nil { + objectMap["upgradeSettings"] = mcapp.UpgradeSettings + } + if mcapp.PowerState != nil { + objectMap["powerState"] = mcapp.PowerState + } + if mcapp.AvailabilityZones != nil { + objectMap["availabilityZones"] = mcapp.AvailabilityZones + } + if mcapp.EnableNodePublicIP != nil { + objectMap["enableNodePublicIP"] = mcapp.EnableNodePublicIP + } + if mcapp.NodePublicIPPrefixID != nil { + objectMap["nodePublicIPPrefixID"] = mcapp.NodePublicIPPrefixID + } + if mcapp.ScaleSetPriority != "" { + objectMap["scaleSetPriority"] = mcapp.ScaleSetPriority + } + if mcapp.ScaleSetEvictionPolicy != "" { + objectMap["scaleSetEvictionPolicy"] = mcapp.ScaleSetEvictionPolicy + } + if mcapp.SpotMaxPrice != nil { + objectMap["spotMaxPrice"] = mcapp.SpotMaxPrice + } + if mcapp.Tags != nil { + objectMap["tags"] = mcapp.Tags + } + if mcapp.NodeLabels != nil { + objectMap["nodeLabels"] = mcapp.NodeLabels + } + if mcapp.NodeTaints != nil { + objectMap["nodeTaints"] = mcapp.NodeTaints + } + if mcapp.ProximityPlacementGroupID != nil { + objectMap["proximityPlacementGroupID"] = mcapp.ProximityPlacementGroupID + } + if mcapp.KubeletConfig != nil { + objectMap["kubeletConfig"] = mcapp.KubeletConfig + } + if mcapp.LinuxOSConfig != nil { + objectMap["linuxOSConfig"] = mcapp.LinuxOSConfig + } + if mcapp.EnableEncryptionAtHost != nil { + objectMap["enableEncryptionAtHost"] = mcapp.EnableEncryptionAtHost + } + if mcapp.EnableUltraSSD != nil { + objectMap["enableUltraSSD"] = mcapp.EnableUltraSSD + } + if mcapp.EnableFIPS != nil { + objectMap["enableFIPS"] = mcapp.EnableFIPS + } + if mcapp.GpuInstanceProfile != "" { + objectMap["gpuInstanceProfile"] = mcapp.GpuInstanceProfile + } + if mcapp.CreationData != nil { + objectMap["creationData"] = mcapp.CreationData + } + return json.Marshal(objectMap) +} + +// ManagedClusterAgentPoolProfileProperties properties for the container service agent pool profile. +type ManagedClusterAgentPoolProfileProperties struct { + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + VMSize *string `json:"vmSize,omitempty"` + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // OsDiskType - Possible values include: 'OSDiskTypeManaged', 'OSDiskTypeEphemeral' + OsDiskType OSDiskType `json:"osDiskType,omitempty"` + // KubeletDiskType - Possible values include: 'KubeletDiskTypeOS', 'KubeletDiskTypeTemporary' + KubeletDiskType KubeletDiskType `json:"kubeletDiskType,omitempty"` + // WorkloadRuntime - Possible values include: 'WorkloadRuntimeOCIContainer', 'WorkloadRuntimeWasmWasi' + WorkloadRuntime WorkloadRuntime `json:"workloadRuntime,omitempty"` + // VnetSubnetID - If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // PodSubnetID - If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + PodSubnetID *string `json:"podSubnetID,omitempty"` + // MaxPods - The maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows' + OsType OSType `json:"osType,omitempty"` + // OsSKU - Possible values include: 'OSSKUUbuntu', 'OSSKUCBLMariner' + OsSKU OSSKU `json:"osSKU,omitempty"` + // MaxCount - The maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - The minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // ScaleDownMode - This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. Possible values include: 'ScaleDownModeDelete', 'ScaleDownModeDeallocate' + ScaleDownMode ScaleDownMode `json:"scaleDownMode,omitempty"` + // Type - Possible values include: 'AgentPoolTypeVirtualMachineScaleSets', 'AgentPoolTypeAvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // Mode - Possible values include: 'AgentPoolModeSystem', 'AgentPoolModeUser' + Mode AgentPoolMode `json:"mode,omitempty"` + // OrchestratorVersion - As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // NodeImageVersion - READ-ONLY; The version of node image + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + // UpgradeSettings - Settings for upgrading the agentpool + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // PowerState - When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded + PowerState *PowerState `json:"powerState,omitempty"` + // AvailabilityZones - The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // NodePublicIPPrefixID - This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` + // ScaleSetPriority - The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. Possible values include: 'ScaleSetPrioritySpot', 'ScaleSetPriorityRegular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. Possible values include: 'ScaleSetEvictionPolicyDelete', 'ScaleSetEvictionPolicyDeallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // SpotMaxPrice - Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` + // Tags - The tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags"` + // NodeLabels - The node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels"` + // NodeTaints - The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` + // ProximityPlacementGroupID - The ID for Proximity Placement Group. + ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"` + // KubeletConfig - The Kubelet configuration on the agent pool nodes. + KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` + // LinuxOSConfig - The OS configuration of Linux agent nodes. + LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` + // EnableEncryptionAtHost - This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` + // EnableUltraSSD - Whether to enable UltraSSD + EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` + // EnableFIPS - See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. + EnableFIPS *bool `json:"enableFIPS,omitempty"` + // GpuInstanceProfile - GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. Possible values include: 'GPUInstanceProfileMIG1g', 'GPUInstanceProfileMIG2g', 'GPUInstanceProfileMIG3g', 'GPUInstanceProfileMIG4g', 'GPUInstanceProfileMIG7g' + GpuInstanceProfile GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + // CreationData - CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. + CreationData *CreationData `json:"creationData,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfileProperties. +func (mcappp ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcappp.Count != nil { + objectMap["count"] = mcappp.Count + } + if mcappp.VMSize != nil { + objectMap["vmSize"] = mcappp.VMSize + } + if mcappp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mcappp.OsDiskSizeGB + } + if mcappp.OsDiskType != "" { + objectMap["osDiskType"] = mcappp.OsDiskType + } + if mcappp.KubeletDiskType != "" { + objectMap["kubeletDiskType"] = mcappp.KubeletDiskType + } + if mcappp.WorkloadRuntime != "" { + objectMap["workloadRuntime"] = mcappp.WorkloadRuntime + } + if mcappp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mcappp.VnetSubnetID + } + if mcappp.PodSubnetID != nil { + objectMap["podSubnetID"] = mcappp.PodSubnetID + } + if mcappp.MaxPods != nil { + objectMap["maxPods"] = mcappp.MaxPods + } + if mcappp.OsType != "" { + objectMap["osType"] = mcappp.OsType + } + if mcappp.OsSKU != "" { + objectMap["osSKU"] = mcappp.OsSKU + } + if mcappp.MaxCount != nil { + objectMap["maxCount"] = mcappp.MaxCount + } + if mcappp.MinCount != nil { + objectMap["minCount"] = mcappp.MinCount + } + if mcappp.EnableAutoScaling != nil { + objectMap["enableAutoScaling"] = mcappp.EnableAutoScaling + } + if mcappp.ScaleDownMode != "" { + objectMap["scaleDownMode"] = mcappp.ScaleDownMode + } + if mcappp.Type != "" { + objectMap["type"] = mcappp.Type + } + if mcappp.Mode != "" { + objectMap["mode"] = mcappp.Mode + } + if mcappp.OrchestratorVersion != nil { + objectMap["orchestratorVersion"] = mcappp.OrchestratorVersion + } + if mcappp.UpgradeSettings != nil { + objectMap["upgradeSettings"] = mcappp.UpgradeSettings + } + if mcappp.PowerState != nil { + objectMap["powerState"] = mcappp.PowerState + } + if mcappp.AvailabilityZones != nil { + objectMap["availabilityZones"] = mcappp.AvailabilityZones + } + if mcappp.EnableNodePublicIP != nil { + objectMap["enableNodePublicIP"] = mcappp.EnableNodePublicIP + } + if mcappp.NodePublicIPPrefixID != nil { + objectMap["nodePublicIPPrefixID"] = mcappp.NodePublicIPPrefixID + } + if mcappp.ScaleSetPriority != "" { + objectMap["scaleSetPriority"] = mcappp.ScaleSetPriority + } + if mcappp.ScaleSetEvictionPolicy != "" { + objectMap["scaleSetEvictionPolicy"] = mcappp.ScaleSetEvictionPolicy + } + if mcappp.SpotMaxPrice != nil { + objectMap["spotMaxPrice"] = mcappp.SpotMaxPrice + } + if mcappp.Tags != nil { + objectMap["tags"] = mcappp.Tags + } + if mcappp.NodeLabels != nil { + objectMap["nodeLabels"] = mcappp.NodeLabels + } + if mcappp.NodeTaints != nil { + objectMap["nodeTaints"] = mcappp.NodeTaints + } + if mcappp.ProximityPlacementGroupID != nil { + objectMap["proximityPlacementGroupID"] = mcappp.ProximityPlacementGroupID + } + if mcappp.KubeletConfig != nil { + objectMap["kubeletConfig"] = mcappp.KubeletConfig + } + if mcappp.LinuxOSConfig != nil { + objectMap["linuxOSConfig"] = mcappp.LinuxOSConfig + } + if mcappp.EnableEncryptionAtHost != nil { + objectMap["enableEncryptionAtHost"] = mcappp.EnableEncryptionAtHost + } + if mcappp.EnableUltraSSD != nil { + objectMap["enableUltraSSD"] = mcappp.EnableUltraSSD + } + if mcappp.EnableFIPS != nil { + objectMap["enableFIPS"] = mcappp.EnableFIPS + } + if mcappp.GpuInstanceProfile != "" { + objectMap["gpuInstanceProfile"] = mcappp.GpuInstanceProfile + } + if mcappp.CreationData != nil { + objectMap["creationData"] = mcappp.CreationData + } + return json.Marshal(objectMap) +} + +// ManagedClusterAPIServerAccessProfile access profile for managed cluster API server. +type ManagedClusterAPIServerAccessProfile struct { + // AuthorizedIPRanges - IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"` + // EnablePrivateCluster - For more details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` + // PrivateDNSZone - The default is System. For more details see [configure private DNS zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are 'system' and 'none'. + PrivateDNSZone *string `json:"privateDNSZone,omitempty"` + // EnablePrivateClusterPublicFQDN - Whether to create additional public FQDN for private cluster or not. + EnablePrivateClusterPublicFQDN *bool `json:"enablePrivateClusterPublicFQDN,omitempty"` + // DisableRunCommand - Whether to disable run command for the cluster or not. + DisableRunCommand *bool `json:"disableRunCommand,omitempty"` +} + +// ManagedClusterAutoUpgradeProfile auto upgrade profile for a managed cluster. +type ManagedClusterAutoUpgradeProfile struct { + // UpgradeChannel - For more information see [setting the AKS cluster auto-upgrade channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). Possible values include: 'UpgradeChannelRapid', 'UpgradeChannelStable', 'UpgradeChannelPatch', 'UpgradeChannelNodeImage', 'UpgradeChannelNone' + UpgradeChannel UpgradeChannel `json:"upgradeChannel,omitempty"` +} + +// ManagedClusterHTTPProxyConfig cluster HTTP proxy configuration. +type ManagedClusterHTTPProxyConfig struct { + // HTTPProxy - The HTTP proxy server endpoint to use. + HTTPProxy *string `json:"httpProxy,omitempty"` + // HTTPSProxy - The HTTPS proxy server endpoint to use. + HTTPSProxy *string `json:"httpsProxy,omitempty"` + // NoProxy - The endpoints that should not go through proxy. + NoProxy *[]string `json:"noProxy,omitempty"` + // TrustedCa - Alternative CA cert to use for connecting to proxy servers. + TrustedCa *string `json:"trustedCa,omitempty"` +} + +// ManagedClusterIdentity identity for the managed cluster. +type ManagedClusterIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity which is used by master components. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity which is used by master components. + TenantID *string `json:"tenantId,omitempty"` + // Type - For more information see [use managed identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedClusterIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterIdentity. +func (mci ManagedClusterIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mci.Type != "" { + objectMap["type"] = mci.Type + } + if mci.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = mci.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ManagedClusterIdentityUserAssignedIdentitiesValue ... +type ManagedClusterIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterIdentityUserAssignedIdentitiesValue. +func (mciAiv ManagedClusterIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ManagedClusterListResult the response from the List Managed Clusters operation. +type ManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of managed clusters. + Value *[]ManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterListResult. +func (mclr ManagedClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mclr.Value != nil { + objectMap["value"] = mclr.Value + } + return json.Marshal(objectMap) +} + +// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. +type ManagedClusterListResultIterator struct { + i int + page ManagedClusterListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedClusterListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ManagedClusterListResultIterator) Response() ManagedClusterListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ManagedClusterListResultIterator) Value() ManagedCluster { + if !iter.page.NotDone() { + return ManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedClusterListResultIterator type. +func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator { + return ManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr ManagedClusterListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mclr ManagedClusterListResult) hasNextLink() bool { + return mclr.NextLink != nil && len(*mclr.NextLink) != 0 +} + +// managedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if !mclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// ManagedClusterListResultPage contains a page of ManagedCluster values. +type ManagedClusterListResultPage struct { + fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error) + mclr ManagedClusterListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedClusterListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedClusterListResultPage) Values() []ManagedCluster { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// Creates a new instance of the ManagedClusterListResultPage type. +func NewManagedClusterListResultPage(cur ManagedClusterListResult, getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { + return ManagedClusterListResultPage{ + fn: getNextPage, + mclr: cur, + } +} + +// ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer. +type ManagedClusterLoadBalancerProfile struct { + // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. + ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` + // OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. + OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` + // OutboundIPs - Desired outbound IP resources for the cluster load balancer. + OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` + // EffectiveOutboundIPs - The effective outbound IP resources of the cluster load balancer. + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` + // AllocatedOutboundPorts - The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` + // IdleTimeoutInMinutes - Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + // EnableMultipleStandardLoadBalancers - Enable multiple standard load balancers per AKS cluster or not. + EnableMultipleStandardLoadBalancers *bool `json:"enableMultipleStandardLoadBalancers,omitempty"` +} + +// ManagedClusterLoadBalancerProfileManagedOutboundIPs desired managed outbound IPs for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { + // Count - The desired number of IPv4 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // CountIPv6 - The desired number of IPv6 outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 0 for single-stack and 1 for dual-stack. + CountIPv6 *int32 `json:"countIPv6,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPPrefixes desired outbound IP Prefix resources for the cluster +// load balancer. +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { + // PublicIPPrefixes - A list of public IP prefix resources. + PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPs desired outbound IP resources for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileOutboundIPs struct { + // PublicIPs - A list of public IP resources. + PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"` +} + +// ManagedClusterManagedOutboundIPProfile profile of the managed outbound IP resources of the managed +// cluster. +type ManagedClusterManagedOutboundIPProfile struct { + // Count - The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` +} + +// ManagedClusterNATGatewayProfile profile of the managed cluster NAT gateway. +type ManagedClusterNATGatewayProfile struct { + // ManagedOutboundIPProfile - Profile of the managed outbound IP resources of the cluster NAT gateway. + ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile `json:"managedOutboundIPProfile,omitempty"` + // EffectiveOutboundIPs - The effective outbound IP resources of the cluster NAT gateway. + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` + // IdleTimeoutInMinutes - Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` +} + +// ManagedClusterPodIdentity details about the pod identity assigned to the Managed Cluster. +type ManagedClusterPodIdentity struct { + // Name - The name of the pod identity. + Name *string `json:"name,omitempty"` + // Namespace - The namespace of the pod identity. + Namespace *string `json:"namespace,omitempty"` + // BindingSelector - The binding selector to use for the AzureIdentityBinding resource. + BindingSelector *string `json:"bindingSelector,omitempty"` + // Identity - The user assigned identity details. + Identity *UserAssignedIdentity `json:"identity,omitempty"` + // ProvisioningState - READ-ONLY; The current provisioning state of the pod identity. Possible values include: 'ManagedClusterPodIdentityProvisioningStateAssigned', 'ManagedClusterPodIdentityProvisioningStateUpdating', 'ManagedClusterPodIdentityProvisioningStateDeleting', 'ManagedClusterPodIdentityProvisioningStateFailed' + ProvisioningState ManagedClusterPodIdentityProvisioningState `json:"provisioningState,omitempty"` + // ProvisioningInfo - READ-ONLY + ProvisioningInfo *ManagedClusterPodIdentityProvisioningInfo `json:"provisioningInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterPodIdentity. +func (mcpi ManagedClusterPodIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcpi.Name != nil { + objectMap["name"] = mcpi.Name + } + if mcpi.Namespace != nil { + objectMap["namespace"] = mcpi.Namespace + } + if mcpi.BindingSelector != nil { + objectMap["bindingSelector"] = mcpi.BindingSelector + } + if mcpi.Identity != nil { + objectMap["identity"] = mcpi.Identity + } + return json.Marshal(objectMap) +} + +// ManagedClusterPodIdentityException see [disable AAD Pod Identity for a specific +// Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) for +// more details. +type ManagedClusterPodIdentityException struct { + // Name - The name of the pod identity exception. + Name *string `json:"name,omitempty"` + // Namespace - The namespace of the pod identity exception. + Namespace *string `json:"namespace,omitempty"` + // PodLabels - The pod labels to match. + PodLabels map[string]*string `json:"podLabels"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterPodIdentityException. +func (mcpie ManagedClusterPodIdentityException) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcpie.Name != nil { + objectMap["name"] = mcpie.Name + } + if mcpie.Namespace != nil { + objectMap["namespace"] = mcpie.Namespace + } + if mcpie.PodLabels != nil { + objectMap["podLabels"] = mcpie.PodLabels + } + return json.Marshal(objectMap) +} + +// ManagedClusterPodIdentityProfile see [use AAD pod +// identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod +// identity integration. +type ManagedClusterPodIdentityProfile struct { + // Enabled - Whether the pod identity addon is enabled. + Enabled *bool `json:"enabled,omitempty"` + // AllowNetworkPluginKubenet - Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) for more information. + AllowNetworkPluginKubenet *bool `json:"allowNetworkPluginKubenet,omitempty"` + // UserAssignedIdentities - The pod identities to use in the cluster. + UserAssignedIdentities *[]ManagedClusterPodIdentity `json:"userAssignedIdentities,omitempty"` + // UserAssignedIdentityExceptions - The pod identity exceptions to allow. + UserAssignedIdentityExceptions *[]ManagedClusterPodIdentityException `json:"userAssignedIdentityExceptions,omitempty"` +} + +// ManagedClusterPodIdentityProvisioningError an error response from the pod identity provisioning. +type ManagedClusterPodIdentityProvisioningError struct { + // Error - Details about the error. + Error *ManagedClusterPodIdentityProvisioningErrorBody `json:"error,omitempty"` +} + +// ManagedClusterPodIdentityProvisioningErrorBody an error response from the pod identity provisioning. +type ManagedClusterPodIdentityProvisioningErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]ManagedClusterPodIdentityProvisioningErrorBody `json:"details,omitempty"` +} + +// ManagedClusterPodIdentityProvisioningInfo ... +type ManagedClusterPodIdentityProvisioningInfo struct { + // Error - Pod identity assignment error (if any). + Error *ManagedClusterPodIdentityProvisioningError `json:"error,omitempty"` +} + +// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. +type ManagedClusterPoolUpgradeProfile struct { + // KubernetesVersion - The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // Name - The Agent Pool name. + Name *string `json:"name,omitempty"` + // OsType - Possible values include: 'OSTypeLinux', 'OSTypeWindows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"` +} + +// ManagedClusterPoolUpgradeProfileUpgradesItem ... +type ManagedClusterPoolUpgradeProfileUpgradesItem struct { + // KubernetesVersion - The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether the Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// ManagedClusterProperties properties of the managed cluster. +type ManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // PowerState - READ-ONLY; The Power State of the cluster. + PowerState *PowerState `json:"powerState,omitempty"` + // MaxAgentPools - READ-ONLY; The max number of agent pools for the managed cluster. + MaxAgentPools *int32 `json:"maxAgentPools,omitempty"` + // KubernetesVersion - When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // DNSPrefix - This cannot be updated once the Managed Cluster has been created. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // FqdnSubdomain - This cannot be updated once the Managed Cluster has been created. + FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"` + // Fqdn - READ-ONLY; The FQDN of the master pool. + Fqdn *string `json:"fqdn,omitempty"` + // PrivateFQDN - READ-ONLY; The FQDN of private cluster. + PrivateFQDN *string `json:"privateFQDN,omitempty"` + // AzurePortalFQDN - READ-ONLY; The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + AzurePortalFQDN *string `json:"azurePortalFQDN,omitempty"` + // AgentPoolProfiles - The agent pool properties. + AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // LinuxProfile - The profile for Linux VMs in the Managed Cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // WindowsProfile - The profile for Windows VMs in the Managed Cluster. + WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // AddonProfiles - The profile of managed cluster add-on. + AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"` + // PodIdentityProfile - See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. + PodIdentityProfile *ManagedClusterPodIdentityProfile `json:"podIdentityProfile,omitempty"` + // NodeResourceGroup - The name of the resource group containing agent pool nodes. + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. + EnableRBAC *bool `json:"enableRBAC,omitempty"` + // EnablePodSecurityPolicy - (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. + EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` + // NetworkProfile - The network configuration profile. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // AadProfile - The Azure Active Directory configuration. + AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` + // AutoUpgradeProfile - The auto upgrade configuration. + AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` + // AutoScalerProfile - Parameters to be applied to the cluster-autoscaler when enabled + AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"` + // APIServerAccessProfile - The access profile for managed cluster API server. + APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` + // DiskEncryptionSetID - This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` + // IdentityProfile - Identities associated with the cluster. + IdentityProfile map[string]*UserAssignedIdentity `json:"identityProfile"` + // PrivateLinkResources - Private link resources associated with the cluster. + PrivateLinkResources *[]PrivateLinkResource `json:"privateLinkResources,omitempty"` + // DisableLocalAccounts - If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` + // HTTPProxyConfig - Configurations for provisioning the cluster with HTTP proxy servers. + HTTPProxyConfig *ManagedClusterHTTPProxyConfig `json:"httpProxyConfig,omitempty"` + // SecurityProfile - Security profile for the managed cluster. + SecurityProfile *ManagedClusterSecurityProfile `json:"securityProfile,omitempty"` + // PublicNetworkAccess - Allow or deny public network access for AKS. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterProperties. +func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcp.KubernetesVersion != nil { + objectMap["kubernetesVersion"] = mcp.KubernetesVersion + } + if mcp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mcp.DNSPrefix + } + if mcp.FqdnSubdomain != nil { + objectMap["fqdnSubdomain"] = mcp.FqdnSubdomain + } + if mcp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles + } + if mcp.LinuxProfile != nil { + objectMap["linuxProfile"] = mcp.LinuxProfile + } + if mcp.WindowsProfile != nil { + objectMap["windowsProfile"] = mcp.WindowsProfile + } + if mcp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile + } + if mcp.AddonProfiles != nil { + objectMap["addonProfiles"] = mcp.AddonProfiles + } + if mcp.PodIdentityProfile != nil { + objectMap["podIdentityProfile"] = mcp.PodIdentityProfile + } + if mcp.NodeResourceGroup != nil { + objectMap["nodeResourceGroup"] = mcp.NodeResourceGroup + } + if mcp.EnableRBAC != nil { + objectMap["enableRBAC"] = mcp.EnableRBAC + } + if mcp.EnablePodSecurityPolicy != nil { + objectMap["enablePodSecurityPolicy"] = mcp.EnablePodSecurityPolicy + } + if mcp.NetworkProfile != nil { + objectMap["networkProfile"] = mcp.NetworkProfile + } + if mcp.AadProfile != nil { + objectMap["aadProfile"] = mcp.AadProfile + } + if mcp.AutoUpgradeProfile != nil { + objectMap["autoUpgradeProfile"] = mcp.AutoUpgradeProfile + } + if mcp.AutoScalerProfile != nil { + objectMap["autoScalerProfile"] = mcp.AutoScalerProfile + } + if mcp.APIServerAccessProfile != nil { + objectMap["apiServerAccessProfile"] = mcp.APIServerAccessProfile + } + if mcp.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetID"] = mcp.DiskEncryptionSetID + } + if mcp.IdentityProfile != nil { + objectMap["identityProfile"] = mcp.IdentityProfile + } + if mcp.PrivateLinkResources != nil { + objectMap["privateLinkResources"] = mcp.PrivateLinkResources + } + if mcp.DisableLocalAccounts != nil { + objectMap["disableLocalAccounts"] = mcp.DisableLocalAccounts + } + if mcp.HTTPProxyConfig != nil { + objectMap["httpProxyConfig"] = mcp.HTTPProxyConfig + } + if mcp.SecurityProfile != nil { + objectMap["securityProfile"] = mcp.SecurityProfile + } + if mcp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = mcp.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// ManagedClusterPropertiesAutoScalerProfile parameters to be applied to the cluster-autoscaler when +// enabled +type ManagedClusterPropertiesAutoScalerProfile struct { + // BalanceSimilarNodeGroups - Valid values are 'true' and 'false' + BalanceSimilarNodeGroups *string `json:"balance-similar-node-groups,omitempty"` + // Expander - If not specified, the default is 'random'. See [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) for more information. Possible values include: 'ExpanderLeastWaste', 'ExpanderMostPods', 'ExpanderPriority', 'ExpanderRandom' + Expander Expander `json:"expander,omitempty"` + // MaxEmptyBulkDelete - The default is 10. + MaxEmptyBulkDelete *string `json:"max-empty-bulk-delete,omitempty"` + // MaxGracefulTerminationSec - The default is 600. + MaxGracefulTerminationSec *string `json:"max-graceful-termination-sec,omitempty"` + // MaxNodeProvisionTime - The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + MaxNodeProvisionTime *string `json:"max-node-provision-time,omitempty"` + // MaxTotalUnreadyPercentage - The default is 45. The maximum is 100 and the minimum is 0. + MaxTotalUnreadyPercentage *string `json:"max-total-unready-percentage,omitempty"` + // NewPodScaleUpDelay - For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + NewPodScaleUpDelay *string `json:"new-pod-scale-up-delay,omitempty"` + // OkTotalUnreadyCount - This must be an integer. The default is 3. + OkTotalUnreadyCount *string `json:"ok-total-unready-count,omitempty"` + // ScanInterval - The default is '10'. Values must be an integer number of seconds. + ScanInterval *string `json:"scan-interval,omitempty"` + // ScaleDownDelayAfterAdd - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownDelayAfterAdd *string `json:"scale-down-delay-after-add,omitempty"` + // ScaleDownDelayAfterDelete - The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownDelayAfterDelete *string `json:"scale-down-delay-after-delete,omitempty"` + // ScaleDownDelayAfterFailure - The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownDelayAfterFailure *string `json:"scale-down-delay-after-failure,omitempty"` + // ScaleDownUnneededTime - The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownUnneededTime *string `json:"scale-down-unneeded-time,omitempty"` + // ScaleDownUnreadyTime - The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownUnreadyTime *string `json:"scale-down-unready-time,omitempty"` + // ScaleDownUtilizationThreshold - The default is '0.5'. + ScaleDownUtilizationThreshold *string `json:"scale-down-utilization-threshold,omitempty"` + // SkipNodesWithLocalStorage - The default is true. + SkipNodesWithLocalStorage *string `json:"skip-nodes-with-local-storage,omitempty"` + // SkipNodesWithSystemPods - The default is true. + SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"` +} + +// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (ManagedCluster, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersCreateOrUpdateFuture.Result. +func (future *ManagedClustersCreateOrUpdateFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.CreateOrUpdateResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersDeleteFuture.Result. +func (future *ManagedClustersDeleteFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClusterSecurityProfile security profile for the container service cluster. +type ManagedClusterSecurityProfile struct { + // AzureDefender - Azure Defender settings for the security profile. + AzureDefender *ManagedClusterSecurityProfileAzureDefender `json:"azureDefender,omitempty"` +} + +// ManagedClusterSecurityProfileAzureDefender azure Defender settings for the security profile. +type ManagedClusterSecurityProfileAzureDefender struct { + // Enabled - Whether to enable Azure Defender + Enabled *bool `json:"enabled,omitempty"` + // LogAnalyticsWorkspaceResourceID - Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field is required and must be a valid workspace resource ID. When Azure Defender is disabled, leave the field empty. + LogAnalyticsWorkspaceResourceID *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` +} + +// ManagedClusterServicePrincipalProfile information about a service principal identity for the cluster to +// use for manipulating Azure APIs. +type ManagedClusterServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` +} + +// ManagedClusterSKU the SKU of a Managed Cluster. +type ManagedClusterSKU struct { + // Name - The name of a managed cluster SKU. Possible values include: 'ManagedClusterSKUNameBasic' + Name ManagedClusterSKUName `json:"name,omitempty"` + // Tier - If not specified, the default is 'Free'. See [uptime SLA](https://docs.microsoft.com/azure/aks/uptime-sla) for more details. Possible values include: 'ManagedClusterSKUTierPaid', 'ManagedClusterSKUTierFree' + Tier ManagedClusterSKUTier `json:"tier,omitempty"` +} + +// ManagedClustersResetAADProfileFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersResetAADProfileFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersResetAADProfileFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersResetAADProfileFuture.Result. +func (future *ManagedClustersResetAADProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetAADProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersResetServicePrincipalProfileFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ManagedClustersResetServicePrincipalProfileFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersResetServicePrincipalProfileFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersResetServicePrincipalProfileFuture.Result. +func (future *ManagedClustersResetServicePrincipalProfileFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetServicePrincipalProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersRotateClusterCertificatesFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ManagedClustersRotateClusterCertificatesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersRotateClusterCertificatesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersRotateClusterCertificatesFuture.Result. +func (future *ManagedClustersRotateClusterCertificatesFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRotateClusterCertificatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersRunCommandFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersRunCommandFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (RunCommandResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersRunCommandFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersRunCommandFuture.Result. +func (future *ManagedClustersRunCommandFuture) result(client ManagedClustersClient) (rcr RunCommandResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRunCommandFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rcr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRunCommandFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { + rcr, err = client.RunCommandResponder(rcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersStartFuture.Result. +func (future *ManagedClustersStartFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersStartFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersStopFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersStopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersStopFuture.Result. +func (future *ManagedClustersStopFuture) result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersStopFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersUpdateTagsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedClustersClient) (ManagedCluster, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedClustersUpdateTagsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagedClustersUpdateTagsFuture.Result. +func (future *ManagedClustersUpdateTagsFuture) result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.UpdateTagsResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. +type ManagedClusterUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The ID of the upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the upgrade profile. + Type *string `json:"type,omitempty"` + // ManagedClusterUpgradeProfileProperties - The properties of the upgrade profile. + *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. +func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcup.ManagedClusterUpgradeProfileProperties != nil { + objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. +func (mcup *ManagedClusterUpgradeProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcup.Type = &typeVar + } + case "properties": + if v != nil { + var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties + err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) + if err != nil { + return err + } + mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties + } + } + } + + return nil +} + +// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. +type ManagedClusterUpgradeProfileProperties struct { + // ControlPlaneProfile - The list of available upgrade versions for the control plane. + ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` + // AgentPoolProfiles - The list of available upgrade versions for agent pools. + AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` +} + +// ManagedClusterWindowsProfile profile for Windows VMs in the managed cluster. +type ManagedClusterWindowsProfile struct { + // AdminUsername - Specifies the name of the administrator account.

**Restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length:** 1 character

**Max-length:** 20 characters + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - Specifies the password of the administrator account.

**Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + AdminPassword *string `json:"adminPassword,omitempty"` + // LicenseType - The license type to use for Windows VMs. See [Azure Hybrid User Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. Possible values include: 'LicenseTypeNone', 'LicenseTypeWindowsServer' + LicenseType LicenseType `json:"licenseType,omitempty"` + // EnableCSIProxy - For more details on CSI proxy, see the [CSI proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + // GmsaProfile - The Windows gMSA Profile in the Managed Cluster. + GmsaProfile *WindowsGmsaProfile `json:"gmsaProfile,omitempty"` +} + +// MasterProfile profile for the container service master. +type MasterProfile struct { + // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + Count *int32 `json:"count,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. + FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageProfileTypesStorageAccount', 'StorageProfileTypesManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` +} + +// MarshalJSON is the custom marshaler for MasterProfile. +func (mp MasterProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mp.Count != nil { + objectMap["count"] = mp.Count + } + if mp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mp.DNSPrefix + } + if mp.VMSize != "" { + objectMap["vmSize"] = mp.VMSize + } + if mp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mp.OsDiskSizeGB + } + if mp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mp.VnetSubnetID + } + if mp.FirstConsecutiveStaticIP != nil { + objectMap["firstConsecutiveStaticIP"] = mp.FirstConsecutiveStaticIP + } + if mp.StorageProfile != "" { + objectMap["storageProfile"] = mp.StorageProfile + } + return json.Marshal(objectMap) +} + +// NetworkProfile profile of network configuration. +type NetworkProfile struct { + // NetworkPlugin - Network plugin used for building the Kubernetes network. Possible values include: 'NetworkPluginAzure', 'NetworkPluginKubenet' + NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"` + // NetworkPolicy - Network policy used for building the Kubernetes network. Possible values include: 'NetworkPolicyCalico', 'NetworkPolicyAzure' + NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` + // NetworkMode - This cannot be specified if networkPlugin is anything other than 'azure'. Possible values include: 'NetworkModeTransparent', 'NetworkModeBridge' + NetworkMode NetworkMode `json:"networkMode,omitempty"` + // PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. + PodCidr *string `json:"podCidr,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + // OutboundType - This can only be set at cluster creation time and cannot be changed later. For more information see [egress outbound type](https://docs.microsoft.com/azure/aks/egress-outboundtype). Possible values include: 'OutboundTypeLoadBalancer', 'OutboundTypeUserDefinedRouting', 'OutboundTypeManagedNATGateway', 'OutboundTypeUserAssignedNATGateway' + OutboundType OutboundType `json:"outboundType,omitempty"` + // LoadBalancerSku - The default is 'standard'. See [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the differences between load balancer SKUs. Possible values include: 'LoadBalancerSkuStandard', 'LoadBalancerSkuBasic' + LoadBalancerSku LoadBalancerSku `json:"loadBalancerSku,omitempty"` + // LoadBalancerProfile - Profile of the cluster load balancer. + LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` + // NatGatewayProfile - Profile of the cluster NAT gateway. + NatGatewayProfile *ManagedClusterNATGatewayProfile `json:"natGatewayProfile,omitempty"` + // PodCidrs - One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + PodCidrs *[]string `json:"podCidrs,omitempty"` + // ServiceCidrs - One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. They must not overlap with any Subnet IP ranges. + ServiceCidrs *[]string `json:"serviceCidrs,omitempty"` + // IPFamilies - IP families are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. + IPFamilies *[]IPFamily `json:"ipFamilies,omitempty"` +} + +// OperationListResult the List Operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationValue describes the properties of a Operation value. +type OperationValue struct { + // Origin - READ-ONLY; The origin of the operation. + Origin *string `json:"origin,omitempty"` + // Name - READ-ONLY; The name of the operation. + Name *string `json:"name,omitempty"` + // OperationValueDisplay - Describes the properties of a Operation Value Display. + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Operation Value Display. +type OperationValueDisplay struct { + // Operation - READ-ONLY; The display name of the operation. + Operation *string `json:"operation,omitempty"` + // Resource - READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValueDisplay. +func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OSOptionProfile the OS option profile. +type OSOptionProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The ID of the OS option resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the OS option resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the OS option resource. + Type *string `json:"type,omitempty"` + // OSOptionPropertyList - The list of OS options. + *OSOptionPropertyList `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OSOptionProfile. +func (oop OSOptionProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oop.OSOptionPropertyList != nil { + objectMap["properties"] = oop.OSOptionPropertyList + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OSOptionProfile struct. +func (oop *OSOptionProfile) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + oop.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + oop.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + oop.Type = &typeVar + } + case "properties": + if v != nil { + var oSOptionPropertyList OSOptionPropertyList + err = json.Unmarshal(*v, &oSOptionPropertyList) + if err != nil { + return err + } + oop.OSOptionPropertyList = &oSOptionPropertyList + } + } + } + + return nil +} + +// OSOptionProperty OS option property. +type OSOptionProperty struct { + // OsType - The OS type. + OsType *string `json:"os-type,omitempty"` + // EnableFipsImage - Whether the image is FIPS-enabled. + EnableFipsImage *bool `json:"enable-fips-image,omitempty"` +} + +// OSOptionPropertyList the list of OS option properties. +type OSOptionPropertyList struct { + // OsOptionPropertyList - The list of OS options. + OsOptionPropertyList *[]OSOptionProperty `json:"osOptionPropertyList,omitempty"` +} + +// OutboundEnvironmentEndpoint egress endpoints which AKS agent nodes connect to for common purpose. +type OutboundEnvironmentEndpoint struct { + // Category - The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. + Category *string `json:"category,omitempty"` + // Endpoints - The endpoints that AKS agent nodes connect to + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` +} + +// OutboundEnvironmentEndpointCollection collection of OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundEnvironmentEndpointCollection. +func (oeec OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oeec.Value != nil { + objectMap["value"] = oeec.Value + } + return json.Marshal(objectMap) +} + +// OutboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionIterator struct { + i int + page OutboundEnvironmentEndpointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OutboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OutboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundEnvironmentEndpointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OutboundEnvironmentEndpointCollectionIterator) Response() OutboundEnvironmentEndpointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OutboundEnvironmentEndpointCollectionIterator) Value() OutboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return OutboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionIterator type. +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return OutboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oeec OutboundEnvironmentEndpointCollection) IsEmpty() bool { + return oeec.Value == nil || len(*oeec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (oeec OutboundEnvironmentEndpointCollection) hasNextLink() bool { + return oeec.NextLink != nil && len(*oeec.NextLink) != 0 +} + +// outboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oeec OutboundEnvironmentEndpointCollection) outboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !oeec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oeec.NextLink))) +} + +// OutboundEnvironmentEndpointCollectionPage contains a page of OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error) + oeec OutboundEnvironmentEndpointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OutboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.oeec) + if err != nil { + return err + } + page.oeec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OutboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.oeec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundEnvironmentEndpointCollectionPage) Response() OutboundEnvironmentEndpointCollection { + return page.oeec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundEnvironmentEndpointCollectionPage) Values() []OutboundEnvironmentEndpoint { + if page.oeec.IsEmpty() { + return nil + } + return *page.oeec.Value +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionPage type. +func NewOutboundEnvironmentEndpointCollectionPage(cur OutboundEnvironmentEndpointCollection, getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return OutboundEnvironmentEndpointCollectionPage{ + fn: getNextPage, + oeec: cur, + } +} + +// PowerState describes the Power State of the cluster +type PowerState struct { + // Code - Tells whether the cluster is Running or Stopped. Possible values include: 'CodeRunning', 'CodeStopped' + Code Code `json:"code,omitempty"` +} + +// PrivateEndpoint private endpoint which a connection belongs to. +type PrivateEndpoint struct { + // ID - The resource ID of the private endpoint + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection a private endpoint connection +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The ID of the private endpoint connection. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the private endpoint connection. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // PrivateEndpointConnectionProperties - The properties of a private endpoint connection. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // ProvisioningState - READ-ONLY; The current provisioning state. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpoint - The resource of private endpoint. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = pecp.PrivateEndpoint + } + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerservice.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // ID - The ID of the private link resource. + ID *string `json:"id,omitempty"` + // Name - The name of the private link resource. + Name *string `json:"name,omitempty"` + // Type - The resource type. + Type *string `json:"type,omitempty"` + // GroupID - The group ID of the resource. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - The RequiredMembers of the resource + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // PrivateLinkServiceID - READ-ONLY; The private link service ID of the resource, this field is exposed only to NRP internally. + PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.ID != nil { + objectMap["id"] = plr.ID + } + if plr.Name != nil { + objectMap["name"] = plr.Name + } + if plr.Type != nil { + objectMap["type"] = plr.Type + } + if plr.GroupID != nil { + objectMap["groupId"] = plr.GroupID + } + if plr.RequiredMembers != nil { + objectMap["requiredMembers"] = plr.RequiredMembers + } + return json.Marshal(objectMap) +} + +// PrivateLinkResourcesListResult a list of private link resources +type PrivateLinkResourcesListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkServiceConnectionState the state of a private link service connection. +type PrivateLinkServiceConnectionState struct { + // Status - The private link service connection status. Possible values include: 'ConnectionStatusPending', 'ConnectionStatusApproved', 'ConnectionStatusRejected', 'ConnectionStatusDisconnected' + Status ConnectionStatus `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceReference a reference to an Azure resource. +type ResourceReference struct { + // ID - The fully qualified Azure resource id. + ID *string `json:"id,omitempty"` +} + +// RunCommandRequest a run command request +type RunCommandRequest struct { + // Command - The command to run. + Command *string `json:"command,omitempty"` + // Context - A base64 encoded zip file containing the files required by the command. + Context *string `json:"context,omitempty"` + // ClusterToken - AuthToken issued for AKS AAD Server App. + ClusterToken *string `json:"clusterToken,omitempty"` +} + +// RunCommandResult run command result. +type RunCommandResult struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The command id. + ID *string `json:"id,omitempty"` + // CommandResultProperties - Properties of command result. + *CommandResultProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunCommandResult. +func (rcr RunCommandResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcr.CommandResultProperties != nil { + objectMap["properties"] = rcr.CommandResultProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunCommandResult struct. +func (rcr *RunCommandResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rcr.ID = &ID + } + case "properties": + if v != nil { + var commandResultProperties CommandResultProperties + err = json.Unmarshal(*v, &commandResultProperties) + if err != nil { + return err + } + rcr.CommandResultProperties = &commandResultProperties + } + } + } + + return nil +} + +// Snapshot a node pool snapshot resource. +type Snapshot struct { + autorest.Response `json:"-"` + // SnapshotProperties - Properties of a snapshot. + *SnapshotProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SnapshotProperties != nil { + objectMap["properties"] = s.SnapshotProperties + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Snapshot struct. +func (s *Snapshot) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var snapshotProperties SnapshotProperties + err = json.Unmarshal(*v, &snapshotProperties) + if err != nil { + return err + } + s.SnapshotProperties = &snapshotProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + s.SystemData = &systemData + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + } + } + + return nil +} + +// SnapshotListResult the response from the List Snapshots operation. +type SnapshotListResult struct { + autorest.Response `json:"-"` + // Value - The list of snapshots. + Value *[]Snapshot `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of snapshot results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotListResult. +func (slr SnapshotListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if slr.Value != nil { + objectMap["value"] = slr.Value + } + return json.Marshal(objectMap) +} + +// SnapshotListResultIterator provides access to a complete listing of Snapshot values. +type SnapshotListResultIterator struct { + i int + page SnapshotListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SnapshotListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SnapshotListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SnapshotListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SnapshotListResultIterator) Response() SnapshotListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SnapshotListResultIterator) Value() Snapshot { + if !iter.page.NotDone() { + return Snapshot{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SnapshotListResultIterator type. +func NewSnapshotListResultIterator(page SnapshotListResultPage) SnapshotListResultIterator { + return SnapshotListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr SnapshotListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (slr SnapshotListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + +// snapshotListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr SnapshotListResult) snapshotListResultPreparer(ctx context.Context) (*http.Request, error) { + if !slr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// SnapshotListResultPage contains a page of Snapshot values. +type SnapshotListResultPage struct { + fn func(context.Context, SnapshotListResult) (SnapshotListResult, error) + slr SnapshotListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SnapshotListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SnapshotListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SnapshotListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SnapshotListResultPage) Response() SnapshotListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SnapshotListResultPage) Values() []Snapshot { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the SnapshotListResultPage type. +func NewSnapshotListResultPage(cur SnapshotListResult, getNextPage func(context.Context, SnapshotListResult) (SnapshotListResult, error)) SnapshotListResultPage { + return SnapshotListResultPage{ + fn: getNextPage, + slr: cur, + } +} + +// SnapshotProperties properties used to configure a node pool snapshot. +type SnapshotProperties struct { + // CreationData - CreationData to be used to specify the source agent pool resource ID to create this snapshot. + CreationData *CreationData `json:"creationData,omitempty"` + // SnapshotType - Possible values include: 'SnapshotTypeNodePool' + SnapshotType SnapshotType `json:"snapshotType,omitempty"` + // KubernetesVersion - READ-ONLY; The version of Kubernetes. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // NodeImageVersion - READ-ONLY; The version of node image. + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + // OsType - READ-ONLY; Possible values include: 'OSTypeLinux', 'OSTypeWindows' + OsType OSType `json:"osType,omitempty"` + // OsSku - READ-ONLY; Possible values include: 'OSSKUUbuntu', 'OSSKUCBLMariner' + OsSku OSSKU `json:"osSku,omitempty"` + // VMSize - READ-ONLY; The size of the VM. + VMSize *string `json:"vmSize,omitempty"` + // EnableFIPS - READ-ONLY; Whether to use a FIPS-enabled OS. + EnableFIPS *bool `json:"enableFIPS,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.CreationData != nil { + objectMap["creationData"] = sp.CreationData + } + if sp.SnapshotType != "" { + objectMap["snapshotType"] = sp.SnapshotType + } + return json.Marshal(objectMap) +} + +// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. +type SSHConfiguration struct { + // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey contains information about SSH certificate public key data. +type SSHPublicKey struct { + // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + KeyData *string `json:"keyData,omitempty"` +} + +// SubResource reference to another subresource. +type SubResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubResource. +func (sr SubResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SysctlConfig sysctl settings for Linux agent nodes. +type SysctlConfig struct { + // NetCoreSomaxconn - Sysctl setting net.core.somaxconn. + NetCoreSomaxconn *int32 `json:"netCoreSomaxconn,omitempty"` + // NetCoreNetdevMaxBacklog - Sysctl setting net.core.netdev_max_backlog. + NetCoreNetdevMaxBacklog *int32 `json:"netCoreNetdevMaxBacklog,omitempty"` + // NetCoreRmemDefault - Sysctl setting net.core.rmem_default. + NetCoreRmemDefault *int32 `json:"netCoreRmemDefault,omitempty"` + // NetCoreRmemMax - Sysctl setting net.core.rmem_max. + NetCoreRmemMax *int32 `json:"netCoreRmemMax,omitempty"` + // NetCoreWmemDefault - Sysctl setting net.core.wmem_default. + NetCoreWmemDefault *int32 `json:"netCoreWmemDefault,omitempty"` + // NetCoreWmemMax - Sysctl setting net.core.wmem_max. + NetCoreWmemMax *int32 `json:"netCoreWmemMax,omitempty"` + // NetCoreOptmemMax - Sysctl setting net.core.optmem_max. + NetCoreOptmemMax *int32 `json:"netCoreOptmemMax,omitempty"` + // NetIpv4TCPMaxSynBacklog - Sysctl setting net.ipv4.tcp_max_syn_backlog. + NetIpv4TCPMaxSynBacklog *int32 `json:"netIpv4TcpMaxSynBacklog,omitempty"` + // NetIpv4TCPMaxTwBuckets - Sysctl setting net.ipv4.tcp_max_tw_buckets. + NetIpv4TCPMaxTwBuckets *int32 `json:"netIpv4TcpMaxTwBuckets,omitempty"` + // NetIpv4TCPFinTimeout - Sysctl setting net.ipv4.tcp_fin_timeout. + NetIpv4TCPFinTimeout *int32 `json:"netIpv4TcpFinTimeout,omitempty"` + // NetIpv4TCPKeepaliveTime - Sysctl setting net.ipv4.tcp_keepalive_time. + NetIpv4TCPKeepaliveTime *int32 `json:"netIpv4TcpKeepaliveTime,omitempty"` + // NetIpv4TCPKeepaliveProbes - Sysctl setting net.ipv4.tcp_keepalive_probes. + NetIpv4TCPKeepaliveProbes *int32 `json:"netIpv4TcpKeepaliveProbes,omitempty"` + // NetIpv4TcpkeepaliveIntvl - Sysctl setting net.ipv4.tcp_keepalive_intvl. + NetIpv4TcpkeepaliveIntvl *int32 `json:"netIpv4TcpkeepaliveIntvl,omitempty"` + // NetIpv4TCPTwReuse - Sysctl setting net.ipv4.tcp_tw_reuse. + NetIpv4TCPTwReuse *bool `json:"netIpv4TcpTwReuse,omitempty"` + // NetIpv4IPLocalPortRange - Sysctl setting net.ipv4.ip_local_port_range. + NetIpv4IPLocalPortRange *string `json:"netIpv4IpLocalPortRange,omitempty"` + // NetIpv4NeighDefaultGcThresh1 - Sysctl setting net.ipv4.neigh.default.gc_thresh1. + NetIpv4NeighDefaultGcThresh1 *int32 `json:"netIpv4NeighDefaultGcThresh1,omitempty"` + // NetIpv4NeighDefaultGcThresh2 - Sysctl setting net.ipv4.neigh.default.gc_thresh2. + NetIpv4NeighDefaultGcThresh2 *int32 `json:"netIpv4NeighDefaultGcThresh2,omitempty"` + // NetIpv4NeighDefaultGcThresh3 - Sysctl setting net.ipv4.neigh.default.gc_thresh3. + NetIpv4NeighDefaultGcThresh3 *int32 `json:"netIpv4NeighDefaultGcThresh3,omitempty"` + // NetNetfilterNfConntrackMax - Sysctl setting net.netfilter.nf_conntrack_max. + NetNetfilterNfConntrackMax *int32 `json:"netNetfilterNfConntrackMax,omitempty"` + // NetNetfilterNfConntrackBuckets - Sysctl setting net.netfilter.nf_conntrack_buckets. + NetNetfilterNfConntrackBuckets *int32 `json:"netNetfilterNfConntrackBuckets,omitempty"` + // FsInotifyMaxUserWatches - Sysctl setting fs.inotify.max_user_watches. + FsInotifyMaxUserWatches *int32 `json:"fsInotifyMaxUserWatches,omitempty"` + // FsFileMax - Sysctl setting fs.file-max. + FsFileMax *int32 `json:"fsFileMax,omitempty"` + // FsAioMaxNr - Sysctl setting fs.aio-max-nr. + FsAioMaxNr *int32 `json:"fsAioMaxNr,omitempty"` + // FsNrOpen - Sysctl setting fs.nr_open. + FsNrOpen *int32 `json:"fsNrOpen,omitempty"` + // KernelThreadsMax - Sysctl setting kernel.threads-max. + KernelThreadsMax *int32 `json:"kernelThreadsMax,omitempty"` + // VMMaxMapCount - Sysctl setting vm.max_map_count. + VMMaxMapCount *int32 `json:"vmMaxMapCount,omitempty"` + // VMSwappiness - Sysctl setting vm.swappiness. + VMSwappiness *int32 `json:"vmSwappiness,omitempty"` + // VMVfsCachePressure - Sysctl setting vm.vfs_cache_pressure. + VMVfsCachePressure *int32 `json:"vmVfsCachePressure,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TagsObject tags object for patch operations. +type TagsObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) +} + +// TimeInWeek time in a week. +type TimeInWeek struct { + // Day - The day of the week. Possible values include: 'WeekDaySunday', 'WeekDayMonday', 'WeekDayTuesday', 'WeekDayWednesday', 'WeekDayThursday', 'WeekDayFriday', 'WeekDaySaturday' + Day WeekDay `json:"day,omitempty"` + // HourSlots - Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + HourSlots *[]int32 `json:"hourSlots,omitempty"` +} + +// TimeSpan for example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. +type TimeSpan struct { + // Start - The start of a time span + Start *date.Time `json:"start,omitempty"` + // End - The end of a time span + End *date.Time `json:"end,omitempty"` +} + +// UserAssignedIdentity details about a user assigned identity. +type UserAssignedIdentity struct { + // ResourceID - The resource ID of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client ID of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object ID of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + +// VMDiagnostics profile for diagnostics on the container service VMs. +type VMDiagnostics struct { + // Enabled - Whether the VM diagnostic agent is provisioned on the VM. + Enabled *bool `json:"enabled,omitempty"` + // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. + StorageURI *string `json:"storageUri,omitempty"` +} + +// MarshalJSON is the custom marshaler for VMDiagnostics. +func (vd VMDiagnostics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vd.Enabled != nil { + objectMap["enabled"] = vd.Enabled + } + return json.Marshal(objectMap) +} + +// WindowsGmsaProfile windows gMSA Profile in the managed cluster. +type WindowsGmsaProfile struct { + // Enabled - Specifies whether to enable Windows gMSA in the managed cluster. + Enabled *bool `json:"enabled,omitempty"` + // DNSServer - Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + DNSServer *string `json:"dnsServer,omitempty"` + // RootDomainName - Specifies the root domain name for Windows gMSA.

Set it to empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + RootDomainName *string `json:"rootDomainName,omitempty"` +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/operations.go b/services/containerservice/mgmt/2022-02-01/containerservice/operations.go new file mode 100644 index 000000000000..ce5556901ec1 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/operations.go @@ -0,0 +1,98 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Container Service Client. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerService/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/privateendpointconnections.go b/services/containerservice/mgmt/2022-02-01/containerservice/privateendpointconnections.go new file mode 100644 index 000000000000..15cc75b100fc --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/privateendpointconnections.go @@ -0,0 +1,406 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the the Container Service Client. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get to learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List to learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateEndpointConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update sends the update request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// privateEndpointConnectionName - the name of the private endpoint connection. +// parameters - the updated private endpoint connection. +func (client PrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateEndpointConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) UpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/privatelinkresources.go b/services/containerservice/mgmt/2022-02-01/containerservice/privatelinkresources.go new file mode 100644 index 000000000000..b53e972174cc --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/privatelinkresources.go @@ -0,0 +1,122 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the the Container Service Client. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List to learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResourcesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.PrivateLinkResourcesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListResponder(resp *http.Response) (result PrivateLinkResourcesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/resolveprivatelinkserviceid.go b/services/containerservice/mgmt/2022-02-01/containerservice/resolveprivatelinkserviceid.go new file mode 100644 index 000000000000..e15143ba9d29 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/resolveprivatelinkserviceid.go @@ -0,0 +1,126 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResolvePrivateLinkServiceIDClient is the the Container Service Client. +type ResolvePrivateLinkServiceIDClient struct { + BaseClient +} + +// NewResolvePrivateLinkServiceIDClient creates an instance of the ResolvePrivateLinkServiceIDClient client. +func NewResolvePrivateLinkServiceIDClient(subscriptionID string) ResolvePrivateLinkServiceIDClient { + return NewResolvePrivateLinkServiceIDClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResolvePrivateLinkServiceIDClientWithBaseURI creates an instance of the ResolvePrivateLinkServiceIDClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewResolvePrivateLinkServiceIDClientWithBaseURI(baseURI string, subscriptionID string) ResolvePrivateLinkServiceIDClient { + return ResolvePrivateLinkServiceIDClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// POST sends the post request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - parameters required in order to resolve a private link service ID. +func (client ResolvePrivateLinkServiceIDClient) POST(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResolvePrivateLinkServiceIDClient.POST") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ResolvePrivateLinkServiceIDClient", "POST", err.Error()) + } + + req, err := client.POSTPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ResolvePrivateLinkServiceIDClient", "POST", nil, "Failure preparing request") + return + } + + resp, err := client.POSTSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ResolvePrivateLinkServiceIDClient", "POST", resp, "Failure sending request") + return + } + + result, err = client.POSTResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ResolvePrivateLinkServiceIDClient", "POST", resp, "Failure responding to request") + return + } + + return +} + +// POSTPreparer prepares the POST request. +func (client ResolvePrivateLinkServiceIDClient) POSTPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.PrivateLinkServiceID = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// POSTSender sends the POST request. The method will close the +// http.Response Body if it receives an error. +func (client ResolvePrivateLinkServiceIDClient) POSTSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// POSTResponder handles the response to the POST request. The method always +// closes the http.Response Body. +func (client ResolvePrivateLinkServiceIDClient) POSTResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/snapshots.go b/services/containerservice/mgmt/2022-02-01/containerservice/snapshots.go new file mode 100644 index 000000000000..536f869529f7 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/snapshots.go @@ -0,0 +1,637 @@ +package containerservice + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SnapshotsClient is the the Container Service Client. +type SnapshotsClient struct { + BaseClient +} + +// NewSnapshotsClient creates an instance of the SnapshotsClient client. +func NewSnapshotsClient(subscriptionID string) SnapshotsClient { + return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { + return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - the snapshot to create or update. +func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters Snapshot) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.SnapshotsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters Snapshot) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.SnapshotsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.SnapshotsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.SnapshotsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "List", resp, "Failure sending request") + return + } + + result.slr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "List", resp, "Failure responding to request") + return + } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotListResult) (result SnapshotListResult, err error) { + req, err := lastResults.snapshotListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup sends the list by resource group request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.SnapshotsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotListResult) (result SnapshotListResult, err error) { + req, err := lastResults.snapshotListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// UpdateTags sends the update tags request. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Update snapshot Tags operation. +func (client SnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.UpdateTags") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.SnapshotsClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "UpdateTags", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "UpdateTags", resp, "Failure sending request") + return + } + + result, err = client.UpdateTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "UpdateTags", resp, "Failure responding to request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client SnapshotsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-02-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) UpdateTagsResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2022-02-01/containerservice/version.go b/services/containerservice/mgmt/2022-02-01/containerservice/version.go new file mode 100644 index 000000000000..dffd59592458 --- /dev/null +++ b/services/containerservice/mgmt/2022-02-01/containerservice/version.go @@ -0,0 +1,19 @@ +package containerservice + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " containerservice/2022-02-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} From 7e00cdf4325403fd09e919fd42faec67592eeb7e Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 13:57:23 +0800 Subject: [PATCH 3/8] Generated from specification/datafactory/resource-manager/readme.md tag package-2018-06 (commit hash: 61218420e95ad3435a029144877b110b56418958) --- .../mgmt/2018-06-01/datafactory/CHANGELOG.md | 1008 +---------------- .../mgmt/2018-06-01/datafactory/_meta.json | 2 +- .../mgmt/2018-06-01/datafactory/models.go | 2 + 3 files changed, 4 insertions(+), 1008 deletions(-) diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md b/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md index 8d7724021d08..9f2afa05ac89 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md +++ b/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md @@ -1,1015 +1,9 @@ # Change History -## Breaking Changes - -### Struct Changes - -#### Removed Struct Fields - -1. FactoryUpdateParameters.PublicNetworkAccess - ## Additive Changes -### New Constants - -1. ScriptActivityLogDestination.ScriptActivityLogDestinationActivityOutput -1. ScriptActivityLogDestination.ScriptActivityLogDestinationExternalStore -1. ScriptActivityParameterDirection.ScriptActivityParameterDirectionInput -1. ScriptActivityParameterDirection.ScriptActivityParameterDirectionInputOutput -1. ScriptActivityParameterDirection.ScriptActivityParameterDirectionOutput -1. ScriptActivityParameterType.ScriptActivityParameterTypeBoolean -1. ScriptActivityParameterType.ScriptActivityParameterTypeDateTime -1. ScriptActivityParameterType.ScriptActivityParameterTypeDateTimeOffset -1. ScriptActivityParameterType.ScriptActivityParameterTypeDecimal -1. ScriptActivityParameterType.ScriptActivityParameterTypeDouble -1. ScriptActivityParameterType.ScriptActivityParameterTypeGUID -1. ScriptActivityParameterType.ScriptActivityParameterTypeInt16 -1. ScriptActivityParameterType.ScriptActivityParameterTypeInt32 -1. ScriptActivityParameterType.ScriptActivityParameterTypeInt64 -1. ScriptActivityParameterType.ScriptActivityParameterTypeSingle -1. ScriptActivityParameterType.ScriptActivityParameterTypeString -1. ScriptActivityParameterType.ScriptActivityParameterTypeTimespan -1. ScriptType.ScriptTypeNonQuery -1. ScriptType.ScriptTypeQuery -1. TeamDeskAuthenticationType.TeamDeskAuthenticationTypeBasic -1. TeamDeskAuthenticationType.TeamDeskAuthenticationTypeToken -1. TypeBasicActivity.TypeBasicActivityTypeScript -1. TypeBasicLinkedService.TypeBasicLinkedServiceTypeQuickbase -1. TypeBasicLinkedService.TypeBasicLinkedServiceTypeSmartsheet -1. TypeBasicLinkedService.TypeBasicLinkedServiceTypeTeamDesk -1. TypeBasicLinkedService.TypeBasicLinkedServiceTypeZendesk -1. ZendeskAuthenticationType.ZendeskAuthenticationTypeBasic -1. ZendeskAuthenticationType.ZendeskAuthenticationTypeToken - -### New Funcs - -1. *FactoryUpdateParameters.UnmarshalJSON([]byte) error -1. *QuickbaseLinkedService.UnmarshalJSON([]byte) error -1. *QuickbaseLinkedServiceTypeProperties.UnmarshalJSON([]byte) error -1. *ScriptActivity.UnmarshalJSON([]byte) error -1. *SmartsheetLinkedService.UnmarshalJSON([]byte) error -1. *SmartsheetLinkedServiceTypeProperties.UnmarshalJSON([]byte) error -1. *TeamDeskLinkedService.UnmarshalJSON([]byte) error -1. *TeamDeskLinkedServiceTypeProperties.UnmarshalJSON([]byte) error -1. *ZendeskLinkedService.UnmarshalJSON([]byte) error -1. *ZendeskLinkedServiceTypeProperties.UnmarshalJSON([]byte) error -1. Activity.AsScriptActivity() (*ScriptActivity, bool) -1. AmazonMWSLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AmazonMWSLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AmazonMWSLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AmazonMWSLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AmazonRdsForOracleLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AmazonRdsForOracleLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AmazonRdsForOracleLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AmazonRdsForOracleLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AmazonRdsForSQLServerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AmazonRdsForSQLServerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AmazonRdsForSQLServerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AmazonRdsForSQLServerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AmazonRedshiftLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AmazonRedshiftLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AmazonRedshiftLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AmazonRedshiftLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AmazonS3CompatibleLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AmazonS3CompatibleLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AmazonS3CompatibleLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AmazonS3CompatibleLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AmazonS3LinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AmazonS3LinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AmazonS3LinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AmazonS3LinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AppendVariableActivity.AsScriptActivity() (*ScriptActivity, bool) -1. AzureBatchLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureBatchLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureBatchLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureBatchLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureBlobFSLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureBlobFSLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureBlobFSLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureBlobFSLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureBlobStorageLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureBlobStorageLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureBlobStorageLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureBlobStorageLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureDataExplorerCommandActivity.AsScriptActivity() (*ScriptActivity, bool) -1. AzureDataExplorerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureDataExplorerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureDataExplorerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureDataExplorerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureDataLakeAnalyticsLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureDataLakeAnalyticsLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureDataLakeAnalyticsLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureDataLakeAnalyticsLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureDataLakeStoreLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureDataLakeStoreLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureDataLakeStoreLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureDataLakeStoreLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureDatabricksDeltaLakeLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureDatabricksDeltaLakeLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureDatabricksDeltaLakeLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureDatabricksDeltaLakeLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureDatabricksLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureDatabricksLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureDatabricksLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureDatabricksLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureFileStorageLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureFileStorageLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureFileStorageLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureFileStorageLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureFunctionActivity.AsScriptActivity() (*ScriptActivity, bool) -1. AzureFunctionLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureFunctionLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureFunctionLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureFunctionLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureKeyVaultLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureKeyVaultLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureKeyVaultLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureKeyVaultLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureMLBatchExecutionActivity.AsScriptActivity() (*ScriptActivity, bool) -1. AzureMLExecutePipelineActivity.AsScriptActivity() (*ScriptActivity, bool) -1. AzureMLLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureMLLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureMLLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureMLLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureMLServiceLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureMLServiceLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureMLServiceLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureMLServiceLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureMLUpdateResourceActivity.AsScriptActivity() (*ScriptActivity, bool) -1. AzureMariaDBLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureMariaDBLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureMariaDBLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureMariaDBLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureMySQLLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureMySQLLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureMySQLLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureMySQLLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzurePostgreSQLLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzurePostgreSQLLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzurePostgreSQLLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzurePostgreSQLLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureSQLDWLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureSQLDWLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureSQLDWLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureSQLDWLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureSQLDatabaseLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureSQLDatabaseLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureSQLDatabaseLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureSQLDatabaseLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureSQLMILinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureSQLMILinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureSQLMILinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureSQLMILinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureSearchLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureSearchLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureSearchLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureSearchLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureStorageLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureStorageLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureStorageLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureStorageLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. AzureTableStorageLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. AzureTableStorageLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. AzureTableStorageLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. AzureTableStorageLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. CassandraLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. CassandraLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. CassandraLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. CassandraLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. CommonDataServiceForAppsLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. CommonDataServiceForAppsLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. CommonDataServiceForAppsLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. CommonDataServiceForAppsLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ConcurLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ConcurLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ConcurLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ConcurLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ControlActivity.AsScriptActivity() (*ScriptActivity, bool) -1. CopyActivity.AsScriptActivity() (*ScriptActivity, bool) -1. CosmosDbLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. CosmosDbLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. CosmosDbLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. CosmosDbLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. CosmosDbMongoDbAPILinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. CosmosDbMongoDbAPILinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. CosmosDbMongoDbAPILinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. CosmosDbMongoDbAPILinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. CouchbaseLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. CouchbaseLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. CouchbaseLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. CouchbaseLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. CustomActivity.AsScriptActivity() (*ScriptActivity, bool) -1. CustomDataSourceLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. CustomDataSourceLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. CustomDataSourceLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. CustomDataSourceLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. DataLakeAnalyticsUSQLActivity.AsScriptActivity() (*ScriptActivity, bool) -1. DatabricksNotebookActivity.AsScriptActivity() (*ScriptActivity, bool) -1. DatabricksSparkJarActivity.AsScriptActivity() (*ScriptActivity, bool) -1. DatabricksSparkPythonActivity.AsScriptActivity() (*ScriptActivity, bool) -1. Db2LinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. Db2LinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. Db2LinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. Db2LinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. DeleteActivity.AsScriptActivity() (*ScriptActivity, bool) -1. DrillLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. DrillLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. DrillLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. DrillLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. DynamicsAXLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. DynamicsAXLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. DynamicsAXLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. DynamicsAXLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. DynamicsCrmLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. DynamicsCrmLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. DynamicsCrmLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. DynamicsCrmLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. DynamicsLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. DynamicsLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. DynamicsLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. DynamicsLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. EloquaLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. EloquaLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. EloquaLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. EloquaLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ExecuteDataFlowActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ExecutePipelineActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ExecuteSSISPackageActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ExecuteWranglingDataflowActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ExecutionActivity.AsScriptActivity() (*ScriptActivity, bool) -1. FailActivity.AsScriptActivity() (*ScriptActivity, bool) -1. FileServerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. FileServerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. FileServerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. FileServerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. FilterActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ForEachActivity.AsScriptActivity() (*ScriptActivity, bool) -1. FtpServerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. FtpServerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. FtpServerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. FtpServerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. GetMetadataActivity.AsScriptActivity() (*ScriptActivity, bool) -1. GoogleAdWordsLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. GoogleAdWordsLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. GoogleAdWordsLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. GoogleAdWordsLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. GoogleBigQueryLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. GoogleBigQueryLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. GoogleBigQueryLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. GoogleBigQueryLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. GoogleCloudStorageLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. GoogleCloudStorageLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. GoogleCloudStorageLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. GoogleCloudStorageLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. GreenplumLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. GreenplumLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. GreenplumLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. GreenplumLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HBaseLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HBaseLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HBaseLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HBaseLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HDInsightHiveActivity.AsScriptActivity() (*ScriptActivity, bool) -1. HDInsightLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HDInsightLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HDInsightLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HDInsightLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HDInsightMapReduceActivity.AsScriptActivity() (*ScriptActivity, bool) -1. HDInsightOnDemandLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HDInsightOnDemandLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HDInsightOnDemandLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HDInsightOnDemandLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HDInsightPigActivity.AsScriptActivity() (*ScriptActivity, bool) -1. HDInsightSparkActivity.AsScriptActivity() (*ScriptActivity, bool) -1. HDInsightStreamingActivity.AsScriptActivity() (*ScriptActivity, bool) -1. HTTPLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HTTPLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HTTPLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HTTPLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HdfsLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HdfsLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HdfsLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HdfsLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HiveLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HiveLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HiveLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HiveLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. HubspotLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. HubspotLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. HubspotLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. HubspotLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. IfConditionActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ImpalaLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ImpalaLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ImpalaLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ImpalaLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. InformixLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. InformixLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. InformixLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. InformixLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. JiraLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. JiraLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. JiraLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. JiraLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. LinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. LinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. LinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. LinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. LookupActivity.AsScriptActivity() (*ScriptActivity, bool) -1. MagentoLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MagentoLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MagentoLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MagentoLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MariaDBLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MariaDBLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MariaDBLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MariaDBLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MarketoLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MarketoLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MarketoLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MarketoLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MicrosoftAccessLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MicrosoftAccessLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MicrosoftAccessLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MicrosoftAccessLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MongoDbAtlasLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MongoDbAtlasLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MongoDbAtlasLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MongoDbAtlasLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MongoDbLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MongoDbLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MongoDbLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MongoDbLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MongoDbV2LinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MongoDbV2LinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MongoDbV2LinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MongoDbV2LinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. MySQLLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. MySQLLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. MySQLLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. MySQLLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. NetezzaLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. NetezzaLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. NetezzaLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. NetezzaLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ODataLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ODataLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ODataLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ODataLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. OdbcLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. OdbcLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. OdbcLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. OdbcLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. Office365LinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. Office365LinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. Office365LinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. Office365LinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. OracleCloudStorageLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. OracleCloudStorageLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. OracleCloudStorageLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. OracleCloudStorageLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. OracleLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. OracleLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. OracleLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. OracleLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. OracleServiceCloudLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. OracleServiceCloudLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. OracleServiceCloudLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. OracleServiceCloudLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. PaypalLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. PaypalLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. PaypalLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. PaypalLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. PhoenixLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. PhoenixLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. PhoenixLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. PhoenixLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. PossibleScriptActivityLogDestinationValues() []ScriptActivityLogDestination -1. PossibleScriptActivityParameterDirectionValues() []ScriptActivityParameterDirection -1. PossibleScriptActivityParameterTypeValues() []ScriptActivityParameterType -1. PossibleScriptTypeValues() []ScriptType -1. PossibleTeamDeskAuthenticationTypeValues() []TeamDeskAuthenticationType -1. PossibleZendeskAuthenticationTypeValues() []ZendeskAuthenticationType -1. PostgreSQLLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. PostgreSQLLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. PostgreSQLLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. PostgreSQLLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. PrestoLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. PrestoLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. PrestoLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. PrestoLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. QuickBooksLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. QuickBooksLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. QuickBooksLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. QuickBooksLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. QuickbaseLinkedService.AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) -1. QuickbaseLinkedService.AsAmazonRdsForOracleLinkedService() (*AmazonRdsForOracleLinkedService, bool) -1. QuickbaseLinkedService.AsAmazonRdsForSQLServerLinkedService() (*AmazonRdsForSQLServerLinkedService, bool) -1. QuickbaseLinkedService.AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) -1. QuickbaseLinkedService.AsAmazonS3CompatibleLinkedService() (*AmazonS3CompatibleLinkedService, bool) -1. QuickbaseLinkedService.AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) -1. QuickbaseLinkedService.AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) -1. QuickbaseLinkedService.AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) -1. QuickbaseLinkedService.AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) -1. QuickbaseLinkedService.AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) -1. QuickbaseLinkedService.AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) -1. QuickbaseLinkedService.AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) -1. QuickbaseLinkedService.AsAzureDatabricksDeltaLakeLinkedService() (*AzureDatabricksDeltaLakeLinkedService, bool) -1. QuickbaseLinkedService.AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) -1. QuickbaseLinkedService.AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) -1. QuickbaseLinkedService.AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) -1. QuickbaseLinkedService.AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) -1. QuickbaseLinkedService.AsAzureMLLinkedService() (*AzureMLLinkedService, bool) -1. QuickbaseLinkedService.AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) -1. QuickbaseLinkedService.AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) -1. QuickbaseLinkedService.AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) -1. QuickbaseLinkedService.AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) -1. QuickbaseLinkedService.AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) -1. QuickbaseLinkedService.AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) -1. QuickbaseLinkedService.AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) -1. QuickbaseLinkedService.AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) -1. QuickbaseLinkedService.AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) -1. QuickbaseLinkedService.AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) -1. QuickbaseLinkedService.AsBasicLinkedService() (BasicLinkedService, bool) -1. QuickbaseLinkedService.AsCassandraLinkedService() (*CassandraLinkedService, bool) -1. QuickbaseLinkedService.AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) -1. QuickbaseLinkedService.AsConcurLinkedService() (*ConcurLinkedService, bool) -1. QuickbaseLinkedService.AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) -1. QuickbaseLinkedService.AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) -1. QuickbaseLinkedService.AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) -1. QuickbaseLinkedService.AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) -1. QuickbaseLinkedService.AsDb2LinkedService() (*Db2LinkedService, bool) -1. QuickbaseLinkedService.AsDrillLinkedService() (*DrillLinkedService, bool) -1. QuickbaseLinkedService.AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) -1. QuickbaseLinkedService.AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) -1. QuickbaseLinkedService.AsDynamicsLinkedService() (*DynamicsLinkedService, bool) -1. QuickbaseLinkedService.AsEloquaLinkedService() (*EloquaLinkedService, bool) -1. QuickbaseLinkedService.AsFileServerLinkedService() (*FileServerLinkedService, bool) -1. QuickbaseLinkedService.AsFtpServerLinkedService() (*FtpServerLinkedService, bool) -1. QuickbaseLinkedService.AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) -1. QuickbaseLinkedService.AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) -1. QuickbaseLinkedService.AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) -1. QuickbaseLinkedService.AsGreenplumLinkedService() (*GreenplumLinkedService, bool) -1. QuickbaseLinkedService.AsHBaseLinkedService() (*HBaseLinkedService, bool) -1. QuickbaseLinkedService.AsHDInsightLinkedService() (*HDInsightLinkedService, bool) -1. QuickbaseLinkedService.AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) -1. QuickbaseLinkedService.AsHTTPLinkedService() (*HTTPLinkedService, bool) -1. QuickbaseLinkedService.AsHdfsLinkedService() (*HdfsLinkedService, bool) -1. QuickbaseLinkedService.AsHiveLinkedService() (*HiveLinkedService, bool) -1. QuickbaseLinkedService.AsHubspotLinkedService() (*HubspotLinkedService, bool) -1. QuickbaseLinkedService.AsImpalaLinkedService() (*ImpalaLinkedService, bool) -1. QuickbaseLinkedService.AsInformixLinkedService() (*InformixLinkedService, bool) -1. QuickbaseLinkedService.AsJiraLinkedService() (*JiraLinkedService, bool) -1. QuickbaseLinkedService.AsLinkedService() (*LinkedService, bool) -1. QuickbaseLinkedService.AsMagentoLinkedService() (*MagentoLinkedService, bool) -1. QuickbaseLinkedService.AsMariaDBLinkedService() (*MariaDBLinkedService, bool) -1. QuickbaseLinkedService.AsMarketoLinkedService() (*MarketoLinkedService, bool) -1. QuickbaseLinkedService.AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) -1. QuickbaseLinkedService.AsMongoDbAtlasLinkedService() (*MongoDbAtlasLinkedService, bool) -1. QuickbaseLinkedService.AsMongoDbLinkedService() (*MongoDbLinkedService, bool) -1. QuickbaseLinkedService.AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) -1. QuickbaseLinkedService.AsMySQLLinkedService() (*MySQLLinkedService, bool) -1. QuickbaseLinkedService.AsNetezzaLinkedService() (*NetezzaLinkedService, bool) -1. QuickbaseLinkedService.AsODataLinkedService() (*ODataLinkedService, bool) -1. QuickbaseLinkedService.AsOdbcLinkedService() (*OdbcLinkedService, bool) -1. QuickbaseLinkedService.AsOffice365LinkedService() (*Office365LinkedService, bool) -1. QuickbaseLinkedService.AsOracleCloudStorageLinkedService() (*OracleCloudStorageLinkedService, bool) -1. QuickbaseLinkedService.AsOracleLinkedService() (*OracleLinkedService, bool) -1. QuickbaseLinkedService.AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) -1. QuickbaseLinkedService.AsPaypalLinkedService() (*PaypalLinkedService, bool) -1. QuickbaseLinkedService.AsPhoenixLinkedService() (*PhoenixLinkedService, bool) -1. QuickbaseLinkedService.AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) -1. QuickbaseLinkedService.AsPrestoLinkedService() (*PrestoLinkedService, bool) -1. QuickbaseLinkedService.AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) -1. QuickbaseLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. QuickbaseLinkedService.AsResponsysLinkedService() (*ResponsysLinkedService, bool) -1. QuickbaseLinkedService.AsRestServiceLinkedService() (*RestServiceLinkedService, bool) -1. QuickbaseLinkedService.AsSQLServerLinkedService() (*SQLServerLinkedService, bool) -1. QuickbaseLinkedService.AsSalesforceLinkedService() (*SalesforceLinkedService, bool) -1. QuickbaseLinkedService.AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) -1. QuickbaseLinkedService.AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) -1. QuickbaseLinkedService.AsSapBWLinkedService() (*SapBWLinkedService, bool) -1. QuickbaseLinkedService.AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) -1. QuickbaseLinkedService.AsSapEccLinkedService() (*SapEccLinkedService, bool) -1. QuickbaseLinkedService.AsSapHanaLinkedService() (*SapHanaLinkedService, bool) -1. QuickbaseLinkedService.AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) -1. QuickbaseLinkedService.AsSapTableLinkedService() (*SapTableLinkedService, bool) -1. QuickbaseLinkedService.AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) -1. QuickbaseLinkedService.AsSftpServerLinkedService() (*SftpServerLinkedService, bool) -1. QuickbaseLinkedService.AsSharePointOnlineListLinkedService() (*SharePointOnlineListLinkedService, bool) -1. QuickbaseLinkedService.AsShopifyLinkedService() (*ShopifyLinkedService, bool) -1. QuickbaseLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. QuickbaseLinkedService.AsSnowflakeLinkedService() (*SnowflakeLinkedService, bool) -1. QuickbaseLinkedService.AsSparkLinkedService() (*SparkLinkedService, bool) -1. QuickbaseLinkedService.AsSquareLinkedService() (*SquareLinkedService, bool) -1. QuickbaseLinkedService.AsSybaseLinkedService() (*SybaseLinkedService, bool) -1. QuickbaseLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. QuickbaseLinkedService.AsTeradataLinkedService() (*TeradataLinkedService, bool) -1. QuickbaseLinkedService.AsVerticaLinkedService() (*VerticaLinkedService, bool) -1. QuickbaseLinkedService.AsWebLinkedService() (*WebLinkedService, bool) -1. QuickbaseLinkedService.AsXeroLinkedService() (*XeroLinkedService, bool) -1. QuickbaseLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. QuickbaseLinkedService.AsZohoLinkedService() (*ZohoLinkedService, bool) -1. QuickbaseLinkedService.MarshalJSON() ([]byte, error) -1. ResponsysLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ResponsysLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ResponsysLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ResponsysLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. RestServiceLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. RestServiceLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. RestServiceLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. RestServiceLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SQLServerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SQLServerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SQLServerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SQLServerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SQLServerStoredProcedureActivity.AsScriptActivity() (*ScriptActivity, bool) -1. SalesforceLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SalesforceLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SalesforceLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SalesforceLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SalesforceMarketingCloudLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SalesforceMarketingCloudLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SalesforceMarketingCloudLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SalesforceMarketingCloudLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SalesforceServiceCloudLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SalesforceServiceCloudLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SalesforceServiceCloudLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SalesforceServiceCloudLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SapBWLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SapBWLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SapBWLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SapBWLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SapCloudForCustomerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SapCloudForCustomerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SapCloudForCustomerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SapCloudForCustomerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SapEccLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SapEccLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SapEccLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SapEccLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SapHanaLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SapHanaLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SapHanaLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SapHanaLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SapOpenHubLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SapOpenHubLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SapOpenHubLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SapOpenHubLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SapTableLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SapTableLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SapTableLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SapTableLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ScriptActivity.AsActivity() (*Activity, bool) -1. ScriptActivity.AsAppendVariableActivity() (*AppendVariableActivity, bool) -1. ScriptActivity.AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) -1. ScriptActivity.AsAzureFunctionActivity() (*AzureFunctionActivity, bool) -1. ScriptActivity.AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) -1. ScriptActivity.AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) -1. ScriptActivity.AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) -1. ScriptActivity.AsBasicActivity() (BasicActivity, bool) -1. ScriptActivity.AsBasicControlActivity() (BasicControlActivity, bool) -1. ScriptActivity.AsBasicExecutionActivity() (BasicExecutionActivity, bool) -1. ScriptActivity.AsControlActivity() (*ControlActivity, bool) -1. ScriptActivity.AsCopyActivity() (*CopyActivity, bool) -1. ScriptActivity.AsCustomActivity() (*CustomActivity, bool) -1. ScriptActivity.AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) -1. ScriptActivity.AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) -1. ScriptActivity.AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) -1. ScriptActivity.AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) -1. ScriptActivity.AsDeleteActivity() (*DeleteActivity, bool) -1. ScriptActivity.AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) -1. ScriptActivity.AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) -1. ScriptActivity.AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) -1. ScriptActivity.AsExecuteWranglingDataflowActivity() (*ExecuteWranglingDataflowActivity, bool) -1. ScriptActivity.AsExecutionActivity() (*ExecutionActivity, bool) -1. ScriptActivity.AsFailActivity() (*FailActivity, bool) -1. ScriptActivity.AsFilterActivity() (*FilterActivity, bool) -1. ScriptActivity.AsForEachActivity() (*ForEachActivity, bool) -1. ScriptActivity.AsGetMetadataActivity() (*GetMetadataActivity, bool) -1. ScriptActivity.AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) -1. ScriptActivity.AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) -1. ScriptActivity.AsHDInsightPigActivity() (*HDInsightPigActivity, bool) -1. ScriptActivity.AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) -1. ScriptActivity.AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) -1. ScriptActivity.AsIfConditionActivity() (*IfConditionActivity, bool) -1. ScriptActivity.AsLookupActivity() (*LookupActivity, bool) -1. ScriptActivity.AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) -1. ScriptActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ScriptActivity.AsSetVariableActivity() (*SetVariableActivity, bool) -1. ScriptActivity.AsSwitchActivity() (*SwitchActivity, bool) -1. ScriptActivity.AsUntilActivity() (*UntilActivity, bool) -1. ScriptActivity.AsValidationActivity() (*ValidationActivity, bool) -1. ScriptActivity.AsWaitActivity() (*WaitActivity, bool) -1. ScriptActivity.AsWebActivity() (*WebActivity, bool) -1. ScriptActivity.AsWebHookActivity() (*WebHookActivity, bool) -1. ScriptActivity.MarshalJSON() ([]byte, error) -1. ServiceNowLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ServiceNowLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ServiceNowLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ServiceNowLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SetVariableActivity.AsScriptActivity() (*ScriptActivity, bool) -1. SftpServerLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SftpServerLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SftpServerLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SftpServerLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SharePointOnlineListLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SharePointOnlineListLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SharePointOnlineListLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SharePointOnlineListLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ShopifyLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ShopifyLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ShopifyLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ShopifyLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SmartsheetLinkedService.AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) -1. SmartsheetLinkedService.AsAmazonRdsForOracleLinkedService() (*AmazonRdsForOracleLinkedService, bool) -1. SmartsheetLinkedService.AsAmazonRdsForSQLServerLinkedService() (*AmazonRdsForSQLServerLinkedService, bool) -1. SmartsheetLinkedService.AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) -1. SmartsheetLinkedService.AsAmazonS3CompatibleLinkedService() (*AmazonS3CompatibleLinkedService, bool) -1. SmartsheetLinkedService.AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) -1. SmartsheetLinkedService.AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) -1. SmartsheetLinkedService.AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) -1. SmartsheetLinkedService.AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) -1. SmartsheetLinkedService.AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) -1. SmartsheetLinkedService.AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) -1. SmartsheetLinkedService.AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) -1. SmartsheetLinkedService.AsAzureDatabricksDeltaLakeLinkedService() (*AzureDatabricksDeltaLakeLinkedService, bool) -1. SmartsheetLinkedService.AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) -1. SmartsheetLinkedService.AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) -1. SmartsheetLinkedService.AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) -1. SmartsheetLinkedService.AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) -1. SmartsheetLinkedService.AsAzureMLLinkedService() (*AzureMLLinkedService, bool) -1. SmartsheetLinkedService.AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) -1. SmartsheetLinkedService.AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) -1. SmartsheetLinkedService.AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) -1. SmartsheetLinkedService.AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) -1. SmartsheetLinkedService.AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) -1. SmartsheetLinkedService.AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) -1. SmartsheetLinkedService.AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) -1. SmartsheetLinkedService.AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) -1. SmartsheetLinkedService.AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) -1. SmartsheetLinkedService.AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) -1. SmartsheetLinkedService.AsBasicLinkedService() (BasicLinkedService, bool) -1. SmartsheetLinkedService.AsCassandraLinkedService() (*CassandraLinkedService, bool) -1. SmartsheetLinkedService.AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) -1. SmartsheetLinkedService.AsConcurLinkedService() (*ConcurLinkedService, bool) -1. SmartsheetLinkedService.AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) -1. SmartsheetLinkedService.AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) -1. SmartsheetLinkedService.AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) -1. SmartsheetLinkedService.AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) -1. SmartsheetLinkedService.AsDb2LinkedService() (*Db2LinkedService, bool) -1. SmartsheetLinkedService.AsDrillLinkedService() (*DrillLinkedService, bool) -1. SmartsheetLinkedService.AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) -1. SmartsheetLinkedService.AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) -1. SmartsheetLinkedService.AsDynamicsLinkedService() (*DynamicsLinkedService, bool) -1. SmartsheetLinkedService.AsEloquaLinkedService() (*EloquaLinkedService, bool) -1. SmartsheetLinkedService.AsFileServerLinkedService() (*FileServerLinkedService, bool) -1. SmartsheetLinkedService.AsFtpServerLinkedService() (*FtpServerLinkedService, bool) -1. SmartsheetLinkedService.AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) -1. SmartsheetLinkedService.AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) -1. SmartsheetLinkedService.AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) -1. SmartsheetLinkedService.AsGreenplumLinkedService() (*GreenplumLinkedService, bool) -1. SmartsheetLinkedService.AsHBaseLinkedService() (*HBaseLinkedService, bool) -1. SmartsheetLinkedService.AsHDInsightLinkedService() (*HDInsightLinkedService, bool) -1. SmartsheetLinkedService.AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) -1. SmartsheetLinkedService.AsHTTPLinkedService() (*HTTPLinkedService, bool) -1. SmartsheetLinkedService.AsHdfsLinkedService() (*HdfsLinkedService, bool) -1. SmartsheetLinkedService.AsHiveLinkedService() (*HiveLinkedService, bool) -1. SmartsheetLinkedService.AsHubspotLinkedService() (*HubspotLinkedService, bool) -1. SmartsheetLinkedService.AsImpalaLinkedService() (*ImpalaLinkedService, bool) -1. SmartsheetLinkedService.AsInformixLinkedService() (*InformixLinkedService, bool) -1. SmartsheetLinkedService.AsJiraLinkedService() (*JiraLinkedService, bool) -1. SmartsheetLinkedService.AsLinkedService() (*LinkedService, bool) -1. SmartsheetLinkedService.AsMagentoLinkedService() (*MagentoLinkedService, bool) -1. SmartsheetLinkedService.AsMariaDBLinkedService() (*MariaDBLinkedService, bool) -1. SmartsheetLinkedService.AsMarketoLinkedService() (*MarketoLinkedService, bool) -1. SmartsheetLinkedService.AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) -1. SmartsheetLinkedService.AsMongoDbAtlasLinkedService() (*MongoDbAtlasLinkedService, bool) -1. SmartsheetLinkedService.AsMongoDbLinkedService() (*MongoDbLinkedService, bool) -1. SmartsheetLinkedService.AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) -1. SmartsheetLinkedService.AsMySQLLinkedService() (*MySQLLinkedService, bool) -1. SmartsheetLinkedService.AsNetezzaLinkedService() (*NetezzaLinkedService, bool) -1. SmartsheetLinkedService.AsODataLinkedService() (*ODataLinkedService, bool) -1. SmartsheetLinkedService.AsOdbcLinkedService() (*OdbcLinkedService, bool) -1. SmartsheetLinkedService.AsOffice365LinkedService() (*Office365LinkedService, bool) -1. SmartsheetLinkedService.AsOracleCloudStorageLinkedService() (*OracleCloudStorageLinkedService, bool) -1. SmartsheetLinkedService.AsOracleLinkedService() (*OracleLinkedService, bool) -1. SmartsheetLinkedService.AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) -1. SmartsheetLinkedService.AsPaypalLinkedService() (*PaypalLinkedService, bool) -1. SmartsheetLinkedService.AsPhoenixLinkedService() (*PhoenixLinkedService, bool) -1. SmartsheetLinkedService.AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) -1. SmartsheetLinkedService.AsPrestoLinkedService() (*PrestoLinkedService, bool) -1. SmartsheetLinkedService.AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) -1. SmartsheetLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SmartsheetLinkedService.AsResponsysLinkedService() (*ResponsysLinkedService, bool) -1. SmartsheetLinkedService.AsRestServiceLinkedService() (*RestServiceLinkedService, bool) -1. SmartsheetLinkedService.AsSQLServerLinkedService() (*SQLServerLinkedService, bool) -1. SmartsheetLinkedService.AsSalesforceLinkedService() (*SalesforceLinkedService, bool) -1. SmartsheetLinkedService.AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) -1. SmartsheetLinkedService.AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) -1. SmartsheetLinkedService.AsSapBWLinkedService() (*SapBWLinkedService, bool) -1. SmartsheetLinkedService.AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) -1. SmartsheetLinkedService.AsSapEccLinkedService() (*SapEccLinkedService, bool) -1. SmartsheetLinkedService.AsSapHanaLinkedService() (*SapHanaLinkedService, bool) -1. SmartsheetLinkedService.AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) -1. SmartsheetLinkedService.AsSapTableLinkedService() (*SapTableLinkedService, bool) -1. SmartsheetLinkedService.AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) -1. SmartsheetLinkedService.AsSftpServerLinkedService() (*SftpServerLinkedService, bool) -1. SmartsheetLinkedService.AsSharePointOnlineListLinkedService() (*SharePointOnlineListLinkedService, bool) -1. SmartsheetLinkedService.AsShopifyLinkedService() (*ShopifyLinkedService, bool) -1. SmartsheetLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SmartsheetLinkedService.AsSnowflakeLinkedService() (*SnowflakeLinkedService, bool) -1. SmartsheetLinkedService.AsSparkLinkedService() (*SparkLinkedService, bool) -1. SmartsheetLinkedService.AsSquareLinkedService() (*SquareLinkedService, bool) -1. SmartsheetLinkedService.AsSybaseLinkedService() (*SybaseLinkedService, bool) -1. SmartsheetLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SmartsheetLinkedService.AsTeradataLinkedService() (*TeradataLinkedService, bool) -1. SmartsheetLinkedService.AsVerticaLinkedService() (*VerticaLinkedService, bool) -1. SmartsheetLinkedService.AsWebLinkedService() (*WebLinkedService, bool) -1. SmartsheetLinkedService.AsXeroLinkedService() (*XeroLinkedService, bool) -1. SmartsheetLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SmartsheetLinkedService.AsZohoLinkedService() (*ZohoLinkedService, bool) -1. SmartsheetLinkedService.MarshalJSON() ([]byte, error) -1. SnowflakeLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SnowflakeLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SnowflakeLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SnowflakeLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SparkLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SparkLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SparkLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SparkLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SquareLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SquareLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SquareLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SquareLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. SwitchActivity.AsScriptActivity() (*ScriptActivity, bool) -1. SybaseLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. SybaseLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. SybaseLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. SybaseLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. TeamDeskLinkedService.AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) -1. TeamDeskLinkedService.AsAmazonRdsForOracleLinkedService() (*AmazonRdsForOracleLinkedService, bool) -1. TeamDeskLinkedService.AsAmazonRdsForSQLServerLinkedService() (*AmazonRdsForSQLServerLinkedService, bool) -1. TeamDeskLinkedService.AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) -1. TeamDeskLinkedService.AsAmazonS3CompatibleLinkedService() (*AmazonS3CompatibleLinkedService, bool) -1. TeamDeskLinkedService.AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) -1. TeamDeskLinkedService.AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) -1. TeamDeskLinkedService.AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) -1. TeamDeskLinkedService.AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) -1. TeamDeskLinkedService.AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) -1. TeamDeskLinkedService.AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) -1. TeamDeskLinkedService.AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) -1. TeamDeskLinkedService.AsAzureDatabricksDeltaLakeLinkedService() (*AzureDatabricksDeltaLakeLinkedService, bool) -1. TeamDeskLinkedService.AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) -1. TeamDeskLinkedService.AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) -1. TeamDeskLinkedService.AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) -1. TeamDeskLinkedService.AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) -1. TeamDeskLinkedService.AsAzureMLLinkedService() (*AzureMLLinkedService, bool) -1. TeamDeskLinkedService.AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) -1. TeamDeskLinkedService.AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) -1. TeamDeskLinkedService.AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) -1. TeamDeskLinkedService.AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) -1. TeamDeskLinkedService.AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) -1. TeamDeskLinkedService.AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) -1. TeamDeskLinkedService.AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) -1. TeamDeskLinkedService.AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) -1. TeamDeskLinkedService.AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) -1. TeamDeskLinkedService.AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) -1. TeamDeskLinkedService.AsBasicLinkedService() (BasicLinkedService, bool) -1. TeamDeskLinkedService.AsCassandraLinkedService() (*CassandraLinkedService, bool) -1. TeamDeskLinkedService.AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) -1. TeamDeskLinkedService.AsConcurLinkedService() (*ConcurLinkedService, bool) -1. TeamDeskLinkedService.AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) -1. TeamDeskLinkedService.AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) -1. TeamDeskLinkedService.AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) -1. TeamDeskLinkedService.AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) -1. TeamDeskLinkedService.AsDb2LinkedService() (*Db2LinkedService, bool) -1. TeamDeskLinkedService.AsDrillLinkedService() (*DrillLinkedService, bool) -1. TeamDeskLinkedService.AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) -1. TeamDeskLinkedService.AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) -1. TeamDeskLinkedService.AsDynamicsLinkedService() (*DynamicsLinkedService, bool) -1. TeamDeskLinkedService.AsEloquaLinkedService() (*EloquaLinkedService, bool) -1. TeamDeskLinkedService.AsFileServerLinkedService() (*FileServerLinkedService, bool) -1. TeamDeskLinkedService.AsFtpServerLinkedService() (*FtpServerLinkedService, bool) -1. TeamDeskLinkedService.AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) -1. TeamDeskLinkedService.AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) -1. TeamDeskLinkedService.AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) -1. TeamDeskLinkedService.AsGreenplumLinkedService() (*GreenplumLinkedService, bool) -1. TeamDeskLinkedService.AsHBaseLinkedService() (*HBaseLinkedService, bool) -1. TeamDeskLinkedService.AsHDInsightLinkedService() (*HDInsightLinkedService, bool) -1. TeamDeskLinkedService.AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) -1. TeamDeskLinkedService.AsHTTPLinkedService() (*HTTPLinkedService, bool) -1. TeamDeskLinkedService.AsHdfsLinkedService() (*HdfsLinkedService, bool) -1. TeamDeskLinkedService.AsHiveLinkedService() (*HiveLinkedService, bool) -1. TeamDeskLinkedService.AsHubspotLinkedService() (*HubspotLinkedService, bool) -1. TeamDeskLinkedService.AsImpalaLinkedService() (*ImpalaLinkedService, bool) -1. TeamDeskLinkedService.AsInformixLinkedService() (*InformixLinkedService, bool) -1. TeamDeskLinkedService.AsJiraLinkedService() (*JiraLinkedService, bool) -1. TeamDeskLinkedService.AsLinkedService() (*LinkedService, bool) -1. TeamDeskLinkedService.AsMagentoLinkedService() (*MagentoLinkedService, bool) -1. TeamDeskLinkedService.AsMariaDBLinkedService() (*MariaDBLinkedService, bool) -1. TeamDeskLinkedService.AsMarketoLinkedService() (*MarketoLinkedService, bool) -1. TeamDeskLinkedService.AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) -1. TeamDeskLinkedService.AsMongoDbAtlasLinkedService() (*MongoDbAtlasLinkedService, bool) -1. TeamDeskLinkedService.AsMongoDbLinkedService() (*MongoDbLinkedService, bool) -1. TeamDeskLinkedService.AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) -1. TeamDeskLinkedService.AsMySQLLinkedService() (*MySQLLinkedService, bool) -1. TeamDeskLinkedService.AsNetezzaLinkedService() (*NetezzaLinkedService, bool) -1. TeamDeskLinkedService.AsODataLinkedService() (*ODataLinkedService, bool) -1. TeamDeskLinkedService.AsOdbcLinkedService() (*OdbcLinkedService, bool) -1. TeamDeskLinkedService.AsOffice365LinkedService() (*Office365LinkedService, bool) -1. TeamDeskLinkedService.AsOracleCloudStorageLinkedService() (*OracleCloudStorageLinkedService, bool) -1. TeamDeskLinkedService.AsOracleLinkedService() (*OracleLinkedService, bool) -1. TeamDeskLinkedService.AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) -1. TeamDeskLinkedService.AsPaypalLinkedService() (*PaypalLinkedService, bool) -1. TeamDeskLinkedService.AsPhoenixLinkedService() (*PhoenixLinkedService, bool) -1. TeamDeskLinkedService.AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) -1. TeamDeskLinkedService.AsPrestoLinkedService() (*PrestoLinkedService, bool) -1. TeamDeskLinkedService.AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) -1. TeamDeskLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. TeamDeskLinkedService.AsResponsysLinkedService() (*ResponsysLinkedService, bool) -1. TeamDeskLinkedService.AsRestServiceLinkedService() (*RestServiceLinkedService, bool) -1. TeamDeskLinkedService.AsSQLServerLinkedService() (*SQLServerLinkedService, bool) -1. TeamDeskLinkedService.AsSalesforceLinkedService() (*SalesforceLinkedService, bool) -1. TeamDeskLinkedService.AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) -1. TeamDeskLinkedService.AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) -1. TeamDeskLinkedService.AsSapBWLinkedService() (*SapBWLinkedService, bool) -1. TeamDeskLinkedService.AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) -1. TeamDeskLinkedService.AsSapEccLinkedService() (*SapEccLinkedService, bool) -1. TeamDeskLinkedService.AsSapHanaLinkedService() (*SapHanaLinkedService, bool) -1. TeamDeskLinkedService.AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) -1. TeamDeskLinkedService.AsSapTableLinkedService() (*SapTableLinkedService, bool) -1. TeamDeskLinkedService.AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) -1. TeamDeskLinkedService.AsSftpServerLinkedService() (*SftpServerLinkedService, bool) -1. TeamDeskLinkedService.AsSharePointOnlineListLinkedService() (*SharePointOnlineListLinkedService, bool) -1. TeamDeskLinkedService.AsShopifyLinkedService() (*ShopifyLinkedService, bool) -1. TeamDeskLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. TeamDeskLinkedService.AsSnowflakeLinkedService() (*SnowflakeLinkedService, bool) -1. TeamDeskLinkedService.AsSparkLinkedService() (*SparkLinkedService, bool) -1. TeamDeskLinkedService.AsSquareLinkedService() (*SquareLinkedService, bool) -1. TeamDeskLinkedService.AsSybaseLinkedService() (*SybaseLinkedService, bool) -1. TeamDeskLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. TeamDeskLinkedService.AsTeradataLinkedService() (*TeradataLinkedService, bool) -1. TeamDeskLinkedService.AsVerticaLinkedService() (*VerticaLinkedService, bool) -1. TeamDeskLinkedService.AsWebLinkedService() (*WebLinkedService, bool) -1. TeamDeskLinkedService.AsXeroLinkedService() (*XeroLinkedService, bool) -1. TeamDeskLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. TeamDeskLinkedService.AsZohoLinkedService() (*ZohoLinkedService, bool) -1. TeamDeskLinkedService.MarshalJSON() ([]byte, error) -1. TeradataLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. TeradataLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. TeradataLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. TeradataLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. UntilActivity.AsScriptActivity() (*ScriptActivity, bool) -1. ValidationActivity.AsScriptActivity() (*ScriptActivity, bool) -1. VerticaLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. VerticaLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. VerticaLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. VerticaLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. WaitActivity.AsScriptActivity() (*ScriptActivity, bool) -1. WebActivity.AsScriptActivity() (*ScriptActivity, bool) -1. WebHookActivity.AsScriptActivity() (*ScriptActivity, bool) -1. WebLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. WebLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. WebLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. WebLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. XeroLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. XeroLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. XeroLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. XeroLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ZendeskLinkedService.AsAmazonMWSLinkedService() (*AmazonMWSLinkedService, bool) -1. ZendeskLinkedService.AsAmazonRdsForOracleLinkedService() (*AmazonRdsForOracleLinkedService, bool) -1. ZendeskLinkedService.AsAmazonRdsForSQLServerLinkedService() (*AmazonRdsForSQLServerLinkedService, bool) -1. ZendeskLinkedService.AsAmazonRedshiftLinkedService() (*AmazonRedshiftLinkedService, bool) -1. ZendeskLinkedService.AsAmazonS3CompatibleLinkedService() (*AmazonS3CompatibleLinkedService, bool) -1. ZendeskLinkedService.AsAmazonS3LinkedService() (*AmazonS3LinkedService, bool) -1. ZendeskLinkedService.AsAzureBatchLinkedService() (*AzureBatchLinkedService, bool) -1. ZendeskLinkedService.AsAzureBlobFSLinkedService() (*AzureBlobFSLinkedService, bool) -1. ZendeskLinkedService.AsAzureBlobStorageLinkedService() (*AzureBlobStorageLinkedService, bool) -1. ZendeskLinkedService.AsAzureDataExplorerLinkedService() (*AzureDataExplorerLinkedService, bool) -1. ZendeskLinkedService.AsAzureDataLakeAnalyticsLinkedService() (*AzureDataLakeAnalyticsLinkedService, bool) -1. ZendeskLinkedService.AsAzureDataLakeStoreLinkedService() (*AzureDataLakeStoreLinkedService, bool) -1. ZendeskLinkedService.AsAzureDatabricksDeltaLakeLinkedService() (*AzureDatabricksDeltaLakeLinkedService, bool) -1. ZendeskLinkedService.AsAzureDatabricksLinkedService() (*AzureDatabricksLinkedService, bool) -1. ZendeskLinkedService.AsAzureFileStorageLinkedService() (*AzureFileStorageLinkedService, bool) -1. ZendeskLinkedService.AsAzureFunctionLinkedService() (*AzureFunctionLinkedService, bool) -1. ZendeskLinkedService.AsAzureKeyVaultLinkedService() (*AzureKeyVaultLinkedService, bool) -1. ZendeskLinkedService.AsAzureMLLinkedService() (*AzureMLLinkedService, bool) -1. ZendeskLinkedService.AsAzureMLServiceLinkedService() (*AzureMLServiceLinkedService, bool) -1. ZendeskLinkedService.AsAzureMariaDBLinkedService() (*AzureMariaDBLinkedService, bool) -1. ZendeskLinkedService.AsAzureMySQLLinkedService() (*AzureMySQLLinkedService, bool) -1. ZendeskLinkedService.AsAzurePostgreSQLLinkedService() (*AzurePostgreSQLLinkedService, bool) -1. ZendeskLinkedService.AsAzureSQLDWLinkedService() (*AzureSQLDWLinkedService, bool) -1. ZendeskLinkedService.AsAzureSQLDatabaseLinkedService() (*AzureSQLDatabaseLinkedService, bool) -1. ZendeskLinkedService.AsAzureSQLMILinkedService() (*AzureSQLMILinkedService, bool) -1. ZendeskLinkedService.AsAzureSearchLinkedService() (*AzureSearchLinkedService, bool) -1. ZendeskLinkedService.AsAzureStorageLinkedService() (*AzureStorageLinkedService, bool) -1. ZendeskLinkedService.AsAzureTableStorageLinkedService() (*AzureTableStorageLinkedService, bool) -1. ZendeskLinkedService.AsBasicLinkedService() (BasicLinkedService, bool) -1. ZendeskLinkedService.AsCassandraLinkedService() (*CassandraLinkedService, bool) -1. ZendeskLinkedService.AsCommonDataServiceForAppsLinkedService() (*CommonDataServiceForAppsLinkedService, bool) -1. ZendeskLinkedService.AsConcurLinkedService() (*ConcurLinkedService, bool) -1. ZendeskLinkedService.AsCosmosDbLinkedService() (*CosmosDbLinkedService, bool) -1. ZendeskLinkedService.AsCosmosDbMongoDbAPILinkedService() (*CosmosDbMongoDbAPILinkedService, bool) -1. ZendeskLinkedService.AsCouchbaseLinkedService() (*CouchbaseLinkedService, bool) -1. ZendeskLinkedService.AsCustomDataSourceLinkedService() (*CustomDataSourceLinkedService, bool) -1. ZendeskLinkedService.AsDb2LinkedService() (*Db2LinkedService, bool) -1. ZendeskLinkedService.AsDrillLinkedService() (*DrillLinkedService, bool) -1. ZendeskLinkedService.AsDynamicsAXLinkedService() (*DynamicsAXLinkedService, bool) -1. ZendeskLinkedService.AsDynamicsCrmLinkedService() (*DynamicsCrmLinkedService, bool) -1. ZendeskLinkedService.AsDynamicsLinkedService() (*DynamicsLinkedService, bool) -1. ZendeskLinkedService.AsEloquaLinkedService() (*EloquaLinkedService, bool) -1. ZendeskLinkedService.AsFileServerLinkedService() (*FileServerLinkedService, bool) -1. ZendeskLinkedService.AsFtpServerLinkedService() (*FtpServerLinkedService, bool) -1. ZendeskLinkedService.AsGoogleAdWordsLinkedService() (*GoogleAdWordsLinkedService, bool) -1. ZendeskLinkedService.AsGoogleBigQueryLinkedService() (*GoogleBigQueryLinkedService, bool) -1. ZendeskLinkedService.AsGoogleCloudStorageLinkedService() (*GoogleCloudStorageLinkedService, bool) -1. ZendeskLinkedService.AsGreenplumLinkedService() (*GreenplumLinkedService, bool) -1. ZendeskLinkedService.AsHBaseLinkedService() (*HBaseLinkedService, bool) -1. ZendeskLinkedService.AsHDInsightLinkedService() (*HDInsightLinkedService, bool) -1. ZendeskLinkedService.AsHDInsightOnDemandLinkedService() (*HDInsightOnDemandLinkedService, bool) -1. ZendeskLinkedService.AsHTTPLinkedService() (*HTTPLinkedService, bool) -1. ZendeskLinkedService.AsHdfsLinkedService() (*HdfsLinkedService, bool) -1. ZendeskLinkedService.AsHiveLinkedService() (*HiveLinkedService, bool) -1. ZendeskLinkedService.AsHubspotLinkedService() (*HubspotLinkedService, bool) -1. ZendeskLinkedService.AsImpalaLinkedService() (*ImpalaLinkedService, bool) -1. ZendeskLinkedService.AsInformixLinkedService() (*InformixLinkedService, bool) -1. ZendeskLinkedService.AsJiraLinkedService() (*JiraLinkedService, bool) -1. ZendeskLinkedService.AsLinkedService() (*LinkedService, bool) -1. ZendeskLinkedService.AsMagentoLinkedService() (*MagentoLinkedService, bool) -1. ZendeskLinkedService.AsMariaDBLinkedService() (*MariaDBLinkedService, bool) -1. ZendeskLinkedService.AsMarketoLinkedService() (*MarketoLinkedService, bool) -1. ZendeskLinkedService.AsMicrosoftAccessLinkedService() (*MicrosoftAccessLinkedService, bool) -1. ZendeskLinkedService.AsMongoDbAtlasLinkedService() (*MongoDbAtlasLinkedService, bool) -1. ZendeskLinkedService.AsMongoDbLinkedService() (*MongoDbLinkedService, bool) -1. ZendeskLinkedService.AsMongoDbV2LinkedService() (*MongoDbV2LinkedService, bool) -1. ZendeskLinkedService.AsMySQLLinkedService() (*MySQLLinkedService, bool) -1. ZendeskLinkedService.AsNetezzaLinkedService() (*NetezzaLinkedService, bool) -1. ZendeskLinkedService.AsODataLinkedService() (*ODataLinkedService, bool) -1. ZendeskLinkedService.AsOdbcLinkedService() (*OdbcLinkedService, bool) -1. ZendeskLinkedService.AsOffice365LinkedService() (*Office365LinkedService, bool) -1. ZendeskLinkedService.AsOracleCloudStorageLinkedService() (*OracleCloudStorageLinkedService, bool) -1. ZendeskLinkedService.AsOracleLinkedService() (*OracleLinkedService, bool) -1. ZendeskLinkedService.AsOracleServiceCloudLinkedService() (*OracleServiceCloudLinkedService, bool) -1. ZendeskLinkedService.AsPaypalLinkedService() (*PaypalLinkedService, bool) -1. ZendeskLinkedService.AsPhoenixLinkedService() (*PhoenixLinkedService, bool) -1. ZendeskLinkedService.AsPostgreSQLLinkedService() (*PostgreSQLLinkedService, bool) -1. ZendeskLinkedService.AsPrestoLinkedService() (*PrestoLinkedService, bool) -1. ZendeskLinkedService.AsQuickBooksLinkedService() (*QuickBooksLinkedService, bool) -1. ZendeskLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ZendeskLinkedService.AsResponsysLinkedService() (*ResponsysLinkedService, bool) -1. ZendeskLinkedService.AsRestServiceLinkedService() (*RestServiceLinkedService, bool) -1. ZendeskLinkedService.AsSQLServerLinkedService() (*SQLServerLinkedService, bool) -1. ZendeskLinkedService.AsSalesforceLinkedService() (*SalesforceLinkedService, bool) -1. ZendeskLinkedService.AsSalesforceMarketingCloudLinkedService() (*SalesforceMarketingCloudLinkedService, bool) -1. ZendeskLinkedService.AsSalesforceServiceCloudLinkedService() (*SalesforceServiceCloudLinkedService, bool) -1. ZendeskLinkedService.AsSapBWLinkedService() (*SapBWLinkedService, bool) -1. ZendeskLinkedService.AsSapCloudForCustomerLinkedService() (*SapCloudForCustomerLinkedService, bool) -1. ZendeskLinkedService.AsSapEccLinkedService() (*SapEccLinkedService, bool) -1. ZendeskLinkedService.AsSapHanaLinkedService() (*SapHanaLinkedService, bool) -1. ZendeskLinkedService.AsSapOpenHubLinkedService() (*SapOpenHubLinkedService, bool) -1. ZendeskLinkedService.AsSapTableLinkedService() (*SapTableLinkedService, bool) -1. ZendeskLinkedService.AsServiceNowLinkedService() (*ServiceNowLinkedService, bool) -1. ZendeskLinkedService.AsSftpServerLinkedService() (*SftpServerLinkedService, bool) -1. ZendeskLinkedService.AsSharePointOnlineListLinkedService() (*SharePointOnlineListLinkedService, bool) -1. ZendeskLinkedService.AsShopifyLinkedService() (*ShopifyLinkedService, bool) -1. ZendeskLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ZendeskLinkedService.AsSnowflakeLinkedService() (*SnowflakeLinkedService, bool) -1. ZendeskLinkedService.AsSparkLinkedService() (*SparkLinkedService, bool) -1. ZendeskLinkedService.AsSquareLinkedService() (*SquareLinkedService, bool) -1. ZendeskLinkedService.AsSybaseLinkedService() (*SybaseLinkedService, bool) -1. ZendeskLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ZendeskLinkedService.AsTeradataLinkedService() (*TeradataLinkedService, bool) -1. ZendeskLinkedService.AsVerticaLinkedService() (*VerticaLinkedService, bool) -1. ZendeskLinkedService.AsWebLinkedService() (*WebLinkedService, bool) -1. ZendeskLinkedService.AsXeroLinkedService() (*XeroLinkedService, bool) -1. ZendeskLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) -1. ZendeskLinkedService.AsZohoLinkedService() (*ZohoLinkedService, bool) -1. ZendeskLinkedService.MarshalJSON() ([]byte, error) -1. ZohoLinkedService.AsQuickbaseLinkedService() (*QuickbaseLinkedService, bool) -1. ZohoLinkedService.AsSmartsheetLinkedService() (*SmartsheetLinkedService, bool) -1. ZohoLinkedService.AsTeamDeskLinkedService() (*TeamDeskLinkedService, bool) -1. ZohoLinkedService.AsZendeskLinkedService() (*ZendeskLinkedService, bool) - ### Struct Changes -#### New Structs - -1. FactoryUpdateProperties -1. QuickbaseLinkedService -1. QuickbaseLinkedServiceTypeProperties -1. ScriptActivity -1. ScriptActivityParameter -1. ScriptActivityScriptBlock -1. ScriptActivityTypeProperties -1. ScriptActivityTypePropertiesLogSettings -1. SmartsheetLinkedService -1. SmartsheetLinkedServiceTypeProperties -1. TeamDeskLinkedService -1. TeamDeskLinkedServiceTypeProperties -1. ZendeskLinkedService -1. ZendeskLinkedServiceTypeProperties - #### New Struct Fields -1. FactoryUpdateParameters.*FactoryUpdateProperties +1. WebActivityTypeProperties.DisableCertValidation diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json b/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json index 0d4888e6326f..423fddfea64a 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json +++ b/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json @@ -1,5 +1,5 @@ { - "commit": "bb4175d29020cfff55f1d9087c2a5a89765067dc", + "commit": "61218420e95ad3435a029144877b110b56418958", "readme": "/_/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md", "tag": "package-2018-06", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index f9dfe1a2f2bf..5e97a5983168 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -258659,6 +258659,8 @@ type WebActivityTypeProperties struct { Body interface{} `json:"body,omitempty"` // Authentication - Authentication method used for calling the endpoint. Authentication *WebActivityAuthentication `json:"authentication,omitempty"` + // DisableCertValidation - When set to true, Certificate validation will be disabled. + DisableCertValidation *bool `json:"disableCertValidation,omitempty"` // Datasets - List of datasets passed to web endpoint. Datasets *[]DatasetReference `json:"datasets,omitempty"` // LinkedServices - List of linked services passed to web endpoint. From 70c9628fc37407e153ecaf1745edd1ea43f38e55 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 13:58:55 +0800 Subject: [PATCH 4/8] Generated from specification/hardwaresecuritymodules/resource-manager/readme.md tag package-2021-11 (commit hash: 61218420e95ad3435a029144877b110b56418958) --- .../hardwaresecuritymodulesapi/models.go | 15 + .../mgmt/hardwaresecuritymodules/models.go | 130 +++ .../hardwaresecuritymodulesapi/models.go | 15 + .../mgmt/hardwaresecuritymodules/models.go | 130 +++ .../hardwaresecuritymodules/CHANGELOG.md | 2 + .../hardwaresecuritymodules/_meta.json | 11 + .../hardwaresecuritymodules/client.go | 41 + .../hardwaresecuritymodules/dedicatedhsm.go | 723 +++++++++++++++ .../hardwaresecuritymodules/enums.go | 83 ++ .../hardwaresecuritymodulesapi/interfaces.go | 35 + .../hardwaresecuritymodules/models.go | 854 ++++++++++++++++++ .../hardwaresecuritymodules/operations.go | 99 ++ .../hardwaresecuritymodules/version.go | 19 + 13 files changed, 2157 insertions(+) create mode 100644 profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go create mode 100644 profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go create mode 100644 profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go create mode 100644 profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/CHANGELOG.md create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/_meta.json create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/client.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/dedicatedhsm.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/enums.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/hardwaresecuritymodulesapi/interfaces.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/models.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/operations.go create mode 100644 services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/version.go diff --git a/profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go b/profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go new file mode 100644 index 000000000000..c8cc82301532 --- /dev/null +++ b/profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go @@ -0,0 +1,15 @@ +//go:build go1.9 +// +build go1.9 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder + +package hardwaresecuritymodulesapi + +import original "github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/hardwaresecuritymodulesapi" + +type DedicatedHsmClientAPI = original.DedicatedHsmClientAPI +type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go b/profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go new file mode 100644 index 000000000000..3aecd53cc396 --- /dev/null +++ b/profiles/latest/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go @@ -0,0 +1,130 @@ +//go:build go1.9 +// +build go1.9 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder + +package hardwaresecuritymodules + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type IdentityType = original.IdentityType + +const ( + IdentityTypeApplication IdentityType = original.IdentityTypeApplication + IdentityTypeKey IdentityType = original.IdentityTypeKey + IdentityTypeManagedIdentity IdentityType = original.IdentityTypeManagedIdentity + IdentityTypeUser IdentityType = original.IdentityTypeUser +) + +type JSONWebKeyType = original.JSONWebKeyType + +const ( + JSONWebKeyTypeAllocating JSONWebKeyType = original.JSONWebKeyTypeAllocating + JSONWebKeyTypeCheckingQuota JSONWebKeyType = original.JSONWebKeyTypeCheckingQuota + JSONWebKeyTypeConnecting JSONWebKeyType = original.JSONWebKeyTypeConnecting + JSONWebKeyTypeDeleting JSONWebKeyType = original.JSONWebKeyTypeDeleting + JSONWebKeyTypeFailed JSONWebKeyType = original.JSONWebKeyTypeFailed + JSONWebKeyTypeProvisioning JSONWebKeyType = original.JSONWebKeyTypeProvisioning + JSONWebKeyTypeSucceeded JSONWebKeyType = original.JSONWebKeyTypeSucceeded +) + +type SkuName = original.SkuName + +const ( + SkuNamePayShield10KLMK1CPS250 SkuName = original.SkuNamePayShield10KLMK1CPS250 + SkuNamePayShield10KLMK1CPS2500 SkuName = original.SkuNamePayShield10KLMK1CPS2500 + SkuNamePayShield10KLMK1CPS60 SkuName = original.SkuNamePayShield10KLMK1CPS60 + SkuNamePayShield10KLMK2CPS250 SkuName = original.SkuNamePayShield10KLMK2CPS250 + SkuNamePayShield10KLMK2CPS2500 SkuName = original.SkuNamePayShield10KLMK2CPS2500 + SkuNamePayShield10KLMK2CPS60 SkuName = original.SkuNamePayShield10KLMK2CPS60 + SkuNameSafeNetLunaNetworkHSMA790 SkuName = original.SkuNameSafeNetLunaNetworkHSMA790 +) + +type APIEntityReference = original.APIEntityReference +type BaseClient = original.BaseClient +type DedicatedHsm = original.DedicatedHsm +type DedicatedHsmClient = original.DedicatedHsmClient +type DedicatedHsmCreateOrUpdateFuture = original.DedicatedHsmCreateOrUpdateFuture +type DedicatedHsmDeleteFuture = original.DedicatedHsmDeleteFuture +type DedicatedHsmError = original.DedicatedHsmError +type DedicatedHsmListResult = original.DedicatedHsmListResult +type DedicatedHsmListResultIterator = original.DedicatedHsmListResultIterator +type DedicatedHsmListResultPage = original.DedicatedHsmListResultPage +type DedicatedHsmOperation = original.DedicatedHsmOperation +type DedicatedHsmOperationDisplay = original.DedicatedHsmOperationDisplay +type DedicatedHsmOperationListResult = original.DedicatedHsmOperationListResult +type DedicatedHsmPatchParameters = original.DedicatedHsmPatchParameters +type DedicatedHsmProperties = original.DedicatedHsmProperties +type DedicatedHsmUpdateFuture = original.DedicatedHsmUpdateFuture +type EndpointDependency = original.EndpointDependency +type EndpointDetail = original.EndpointDetail +type Error = original.Error +type NetworkInterface = original.NetworkInterface +type NetworkProfile = original.NetworkProfile +type OperationsClient = original.OperationsClient +type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection = original.OutboundEnvironmentEndpointCollection +type OutboundEnvironmentEndpointCollectionIterator = original.OutboundEnvironmentEndpointCollectionIterator +type OutboundEnvironmentEndpointCollectionPage = original.OutboundEnvironmentEndpointCollectionPage +type Resource = original.Resource +type ResourceListResult = original.ResourceListResult +type Sku = original.Sku +type SystemData = original.SystemData + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewDedicatedHsmClient(subscriptionID string) DedicatedHsmClient { + return original.NewDedicatedHsmClient(subscriptionID) +} +func NewDedicatedHsmClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHsmClient { + return original.NewDedicatedHsmClientWithBaseURI(baseURI, subscriptionID) +} +func NewDedicatedHsmListResultIterator(page DedicatedHsmListResultPage) DedicatedHsmListResultIterator { + return original.NewDedicatedHsmListResultIterator(page) +} +func NewDedicatedHsmListResultPage(cur DedicatedHsmListResult, getNextPage func(context.Context, DedicatedHsmListResult) (DedicatedHsmListResult, error)) DedicatedHsmListResultPage { + return original.NewDedicatedHsmListResultPage(cur, getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return original.NewOutboundEnvironmentEndpointCollectionIterator(page) +} +func NewOutboundEnvironmentEndpointCollectionPage(cur OutboundEnvironmentEndpointCollection, getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return original.NewOutboundEnvironmentEndpointCollectionPage(cur, getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { + return original.PossibleJSONWebKeyTypeValues() +} +func PossibleSkuNameValues() []SkuName { + return original.PossibleSkuNameValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go b/profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go new file mode 100644 index 000000000000..c8cc82301532 --- /dev/null +++ b/profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/hardwaresecuritymodulesapi/models.go @@ -0,0 +1,15 @@ +//go:build go1.9 +// +build go1.9 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder + +package hardwaresecuritymodulesapi + +import original "github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/hardwaresecuritymodulesapi" + +type DedicatedHsmClientAPI = original.DedicatedHsmClientAPI +type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go b/profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go new file mode 100644 index 000000000000..d3a9edeea032 --- /dev/null +++ b/profiles/preview/hardwaresecuritymodules/mgmt/hardwaresecuritymodules/models.go @@ -0,0 +1,130 @@ +//go:build go1.9 +// +build go1.9 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder + +package hardwaresecuritymodules + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type IdentityType = original.IdentityType + +const ( + IdentityTypeApplication IdentityType = original.IdentityTypeApplication + IdentityTypeKey IdentityType = original.IdentityTypeKey + IdentityTypeManagedIdentity IdentityType = original.IdentityTypeManagedIdentity + IdentityTypeUser IdentityType = original.IdentityTypeUser +) + +type JSONWebKeyType = original.JSONWebKeyType + +const ( + JSONWebKeyTypeAllocating JSONWebKeyType = original.JSONWebKeyTypeAllocating + JSONWebKeyTypeCheckingQuota JSONWebKeyType = original.JSONWebKeyTypeCheckingQuota + JSONWebKeyTypeConnecting JSONWebKeyType = original.JSONWebKeyTypeConnecting + JSONWebKeyTypeDeleting JSONWebKeyType = original.JSONWebKeyTypeDeleting + JSONWebKeyTypeFailed JSONWebKeyType = original.JSONWebKeyTypeFailed + JSONWebKeyTypeProvisioning JSONWebKeyType = original.JSONWebKeyTypeProvisioning + JSONWebKeyTypeSucceeded JSONWebKeyType = original.JSONWebKeyTypeSucceeded +) + +type SkuName = original.SkuName + +const ( + SkuNamePayShield10KLMK1CPS250 SkuName = original.SkuNamePayShield10KLMK1CPS250 + SkuNamePayShield10KLMK1CPS2500 SkuName = original.SkuNamePayShield10KLMK1CPS2500 + SkuNamePayShield10KLMK1CPS60 SkuName = original.SkuNamePayShield10KLMK1CPS60 + SkuNamePayShield10KLMK2CPS250 SkuName = original.SkuNamePayShield10KLMK2CPS250 + SkuNamePayShield10KLMK2CPS2500 SkuName = original.SkuNamePayShield10KLMK2CPS2500 + SkuNamePayShield10KLMK2CPS60 SkuName = original.SkuNamePayShield10KLMK2CPS60 + SkuNameSafeNetLunaNetworkHSMA790 SkuName = original.SkuNameSafeNetLunaNetworkHSMA790 +) + +type APIEntityReference = original.APIEntityReference +type BaseClient = original.BaseClient +type DedicatedHsm = original.DedicatedHsm +type DedicatedHsmClient = original.DedicatedHsmClient +type DedicatedHsmCreateOrUpdateFuture = original.DedicatedHsmCreateOrUpdateFuture +type DedicatedHsmDeleteFuture = original.DedicatedHsmDeleteFuture +type DedicatedHsmError = original.DedicatedHsmError +type DedicatedHsmListResult = original.DedicatedHsmListResult +type DedicatedHsmListResultIterator = original.DedicatedHsmListResultIterator +type DedicatedHsmListResultPage = original.DedicatedHsmListResultPage +type DedicatedHsmOperation = original.DedicatedHsmOperation +type DedicatedHsmOperationDisplay = original.DedicatedHsmOperationDisplay +type DedicatedHsmOperationListResult = original.DedicatedHsmOperationListResult +type DedicatedHsmPatchParameters = original.DedicatedHsmPatchParameters +type DedicatedHsmProperties = original.DedicatedHsmProperties +type DedicatedHsmUpdateFuture = original.DedicatedHsmUpdateFuture +type EndpointDependency = original.EndpointDependency +type EndpointDetail = original.EndpointDetail +type Error = original.Error +type NetworkInterface = original.NetworkInterface +type NetworkProfile = original.NetworkProfile +type OperationsClient = original.OperationsClient +type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection = original.OutboundEnvironmentEndpointCollection +type OutboundEnvironmentEndpointCollectionIterator = original.OutboundEnvironmentEndpointCollectionIterator +type OutboundEnvironmentEndpointCollectionPage = original.OutboundEnvironmentEndpointCollectionPage +type Resource = original.Resource +type ResourceListResult = original.ResourceListResult +type Sku = original.Sku +type SystemData = original.SystemData + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewDedicatedHsmClient(subscriptionID string) DedicatedHsmClient { + return original.NewDedicatedHsmClient(subscriptionID) +} +func NewDedicatedHsmClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHsmClient { + return original.NewDedicatedHsmClientWithBaseURI(baseURI, subscriptionID) +} +func NewDedicatedHsmListResultIterator(page DedicatedHsmListResultPage) DedicatedHsmListResultIterator { + return original.NewDedicatedHsmListResultIterator(page) +} +func NewDedicatedHsmListResultPage(cur DedicatedHsmListResult, getNextPage func(context.Context, DedicatedHsmListResult) (DedicatedHsmListResult, error)) DedicatedHsmListResultPage { + return original.NewDedicatedHsmListResultPage(cur, getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return original.NewOutboundEnvironmentEndpointCollectionIterator(page) +} +func NewOutboundEnvironmentEndpointCollectionPage(cur OutboundEnvironmentEndpointCollection, getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return original.NewOutboundEnvironmentEndpointCollectionPage(cur, getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { + return original.PossibleJSONWebKeyTypeValues() +} +func PossibleSkuNameValues() []SkuName { + return original.PossibleSkuNameValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/CHANGELOG.md b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/_meta.json b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/_meta.json new file mode 100644 index 000000000000..556bf86ea336 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "61218420e95ad3435a029144877b110b56418958", + "readme": "/_/azure-rest-api-specs/specification/hardwaresecuritymodules/resource-manager/readme.md", + "tag": "package-2021-11", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-11 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/hardwaresecuritymodules/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/client.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/client.go new file mode 100644 index 000000000000..19d4685d7d02 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/client.go @@ -0,0 +1,41 @@ +// Package hardwaresecuritymodules implements the Azure ARM Hardwaresecuritymodules service API version 2021-11-30. +// +// The Azure management API provides a RESTful set of web services that interact with Azure Dedicated HSM RP. +package hardwaresecuritymodules + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Hardwaresecuritymodules + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Hardwaresecuritymodules. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/dedicatedhsm.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/dedicatedhsm.go new file mode 100644 index 000000000000..994c9c683bed --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/dedicatedhsm.go @@ -0,0 +1,723 @@ +package hardwaresecuritymodules + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DedicatedHsmClient is the the Azure management API provides a RESTful set of web services that interact with Azure +// Dedicated HSM RP. +type DedicatedHsmClient struct { + BaseClient +} + +// NewDedicatedHsmClient creates an instance of the DedicatedHsmClient client. +func NewDedicatedHsmClient(subscriptionID string) DedicatedHsmClient { + return NewDedicatedHsmClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDedicatedHsmClientWithBaseURI creates an instance of the DedicatedHsmClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDedicatedHsmClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHsmClient { + return DedicatedHsmClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a dedicated HSM in the specified subscription. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the resource belongs. +// name - name of the dedicated Hsm +// parameters - parameters to create or update the dedicated hsm +func (client DedicatedHsmClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters DedicatedHsm) (result DedicatedHsmCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DedicatedHsmProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("hardwaresecuritymodules.DedicatedHsmClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DedicatedHsmClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, parameters DedicatedHsm) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) CreateOrUpdateSender(req *http.Request) (future DedicatedHsmCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHsm, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified Azure Dedicated HSM. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the dedicated HSM belongs. +// name - the name of the dedicated HSM to delete +func (client DedicatedHsmClient) Delete(ctx context.Context, resourceGroupName string, name string) (result DedicatedHsmDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DedicatedHsmClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) DeleteSender(req *http.Request) (future DedicatedHsmDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified Azure dedicated HSM. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the dedicated hsm belongs. +// name - the name of the dedicated HSM. +func (client DedicatedHsmClient) Get(ctx context.Context, resourceGroupName string, name string) (result DedicatedHsm, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DedicatedHsmClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) GetResponder(resp *http.Response) (result DedicatedHsm, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup the List operation gets information about the dedicated hsms associated with the subscription +// and within the specified resource group. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the dedicated HSM belongs. +// top - maximum number of results to return. +func (client DedicatedHsmClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result DedicatedHsmListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dhlr.Response.Response != nil { + sc = result.dhlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dhlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dhlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DedicatedHsmClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHsmListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client DedicatedHsmClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedHsmListResult) (result DedicatedHsmListResult, err error) { + req, err := lastResults.dedicatedHsmListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DedicatedHsmClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, top *int32) (result DedicatedHsmListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, top) + return +} + +// ListBySubscription the List operation gets information about the dedicated HSMs associated with the subscription. +// Parameters: +// top - maximum number of results to return. +func (client DedicatedHsmClient) ListBySubscription(ctx context.Context, top *int32) (result DedicatedHsmListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.ListBySubscription") + defer func() { + sc := -1 + if result.dhlr.Response.Response != nil { + sc = result.dhlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, top) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.dhlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.dhlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client DedicatedHsmClient) ListBySubscriptionPreparer(ctx context.Context, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHsmListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client DedicatedHsmClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedHsmListResult) (result DedicatedHsmListResult, err error) { + req, err := lastResults.dedicatedHsmListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client DedicatedHsmClient) ListBySubscriptionComplete(ctx context.Context, top *int32) (result DedicatedHsmListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, top) + return +} + +// ListOutboundNetworkDependenciesEndpoints gets a list of egress endpoints (network endpoints of all outbound +// dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the dedicated hsm belongs. +// name - the name of the dedicated HSM. +func (client DedicatedHsmClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.ListOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.oeec.Response.Response != nil { + sc = result.oeec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOutboundNetworkDependenciesEndpointsNextResults + req, err := client.ListOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.oeec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result.oeec, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + if result.oeec.hasNextLink() && result.oeec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOutboundNetworkDependenciesEndpointsPreparer prepares the ListOutboundNetworkDependenciesEndpoints request. +func (client DedicatedHsmClient) ListOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOutboundNetworkDependenciesEndpointsSender sends the ListOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) ListOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOutboundNetworkDependenciesEndpointsResponder handles the response to the ListOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) ListOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundEnvironmentEndpointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client DedicatedHsmClient) listOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundEnvironmentEndpointCollection) (result OutboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.outboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client DedicatedHsmClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.ListOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + +// Update update a dedicated HSM in the specified subscription. +// Parameters: +// resourceGroupName - the name of the Resource Group to which the server belongs. +// name - name of the dedicated HSM +// parameters - parameters to patch the dedicated HSM +func (client DedicatedHsmClient) Update(ctx context.Context, resourceGroupName string, name string, parameters DedicatedHsmPatchParameters) (result DedicatedHsmUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: name, + Constraints: []validation.Constraint{{Target: "name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]{3,24}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("hardwaresecuritymodules.DedicatedHsmClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DedicatedHsmClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, parameters DedicatedHsmPatchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHsmClient) UpdateSender(req *http.Request) (future DedicatedHsmUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DedicatedHsmClient) UpdateResponder(resp *http.Response) (result DedicatedHsm, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/enums.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/enums.go new file mode 100644 index 000000000000..979bed16b37f --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/enums.go @@ -0,0 +1,83 @@ +package hardwaresecuritymodules + +// 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. + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // IdentityTypeApplication ... + IdentityTypeApplication IdentityType = "Application" + // IdentityTypeKey ... + IdentityTypeKey IdentityType = "Key" + // IdentityTypeManagedIdentity ... + IdentityTypeManagedIdentity IdentityType = "ManagedIdentity" + // IdentityTypeUser ... + IdentityTypeUser IdentityType = "User" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{IdentityTypeApplication, IdentityTypeKey, IdentityTypeManagedIdentity, IdentityTypeUser} +} + +// JSONWebKeyType enumerates the values for json web key type. +type JSONWebKeyType string + +const ( + // JSONWebKeyTypeAllocating A device is currently being allocated for the dedicated HSM resource. + JSONWebKeyTypeAllocating JSONWebKeyType = "Allocating" + // JSONWebKeyTypeCheckingQuota Validating the subscription has sufficient quota to allocate a dedicated HSM + // device. + JSONWebKeyTypeCheckingQuota JSONWebKeyType = "CheckingQuota" + // JSONWebKeyTypeConnecting The dedicated HSM is being connected to the virtual network. + JSONWebKeyTypeConnecting JSONWebKeyType = "Connecting" + // JSONWebKeyTypeDeleting The dedicated HSM is currently being deleted. + JSONWebKeyTypeDeleting JSONWebKeyType = "Deleting" + // JSONWebKeyTypeFailed Provisioning of the dedicated HSM has failed. + JSONWebKeyTypeFailed JSONWebKeyType = "Failed" + // JSONWebKeyTypeProvisioning The dedicated HSM is currently being provisioned. + JSONWebKeyTypeProvisioning JSONWebKeyType = "Provisioning" + // JSONWebKeyTypeSucceeded The dedicated HSM has been full provisioned. + JSONWebKeyTypeSucceeded JSONWebKeyType = "Succeeded" +) + +// PossibleJSONWebKeyTypeValues returns an array of possible values for the JSONWebKeyType const type. +func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { + return []JSONWebKeyType{JSONWebKeyTypeAllocating, JSONWebKeyTypeCheckingQuota, JSONWebKeyTypeConnecting, JSONWebKeyTypeDeleting, JSONWebKeyTypeFailed, JSONWebKeyTypeProvisioning, JSONWebKeyTypeSucceeded} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // SkuNamePayShield10KLMK1CPS250 The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware + // Platform device with 1 local master key which supports up to 250 calls per second. + SkuNamePayShield10KLMK1CPS250 SkuName = "payShield10K_LMK1_CPS250" + // SkuNamePayShield10KLMK1CPS2500 The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet + // Hardware Platform device with 1 local master key which supports up to 2500 calls per second. + SkuNamePayShield10KLMK1CPS2500 SkuName = "payShield10K_LMK1_CPS2500" + // SkuNamePayShield10KLMK1CPS60 The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware + // Platform device with 1 local master key which supports up to 60 calls per second. + SkuNamePayShield10KLMK1CPS60 SkuName = "payShield10K_LMK1_CPS60" + // SkuNamePayShield10KLMK2CPS250 The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware + // Platform device with 2 local master keys which supports up to 250 calls per second. + SkuNamePayShield10KLMK2CPS250 SkuName = "payShield10K_LMK2_CPS250" + // SkuNamePayShield10KLMK2CPS2500 The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet + // Hardware Platform device with 2 local master keys which supports up to 2500 calls per second. + SkuNamePayShield10KLMK2CPS2500 SkuName = "payShield10K_LMK2_CPS2500" + // SkuNamePayShield10KLMK2CPS60 The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware + // Platform device with 2 local master keys which supports up to 60 calls per second. + SkuNamePayShield10KLMK2CPS60 SkuName = "payShield10K_LMK2_CPS60" + // SkuNameSafeNetLunaNetworkHSMA790 The dedicated HSM is a Safenet Luna Network HSM A790 device. + SkuNameSafeNetLunaNetworkHSMA790 SkuName = "SafeNet Luna Network HSM A790" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{SkuNamePayShield10KLMK1CPS250, SkuNamePayShield10KLMK1CPS2500, SkuNamePayShield10KLMK1CPS60, SkuNamePayShield10KLMK2CPS250, SkuNamePayShield10KLMK2CPS2500, SkuNamePayShield10KLMK2CPS60, SkuNameSafeNetLunaNetworkHSMA790} +} diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/hardwaresecuritymodulesapi/interfaces.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/hardwaresecuritymodulesapi/interfaces.go new file mode 100644 index 000000000000..e6f772e20b07 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/hardwaresecuritymodulesapi/interfaces.go @@ -0,0 +1,35 @@ +package hardwaresecuritymodulesapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result hardwaresecuritymodules.DedicatedHsmOperationListResult, err error) +} + +var _ OperationsClientAPI = (*hardwaresecuritymodules.OperationsClient)(nil) + +// DedicatedHsmClientAPI contains the set of methods on the DedicatedHsmClient type. +type DedicatedHsmClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters hardwaresecuritymodules.DedicatedHsm) (result hardwaresecuritymodules.DedicatedHsmCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, name string) (result hardwaresecuritymodules.DedicatedHsmDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result hardwaresecuritymodules.DedicatedHsm, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result hardwaresecuritymodules.DedicatedHsmListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, top *int32) (result hardwaresecuritymodules.DedicatedHsmListResultIterator, err error) + ListBySubscription(ctx context.Context, top *int32) (result hardwaresecuritymodules.DedicatedHsmListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context, top *int32) (result hardwaresecuritymodules.DedicatedHsmListResultIterator, err error) + ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result hardwaresecuritymodules.OutboundEnvironmentEndpointCollectionPage, err error) + ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result hardwaresecuritymodules.OutboundEnvironmentEndpointCollectionIterator, err error) + Update(ctx context.Context, resourceGroupName string, name string, parameters hardwaresecuritymodules.DedicatedHsmPatchParameters) (result hardwaresecuritymodules.DedicatedHsmUpdateFuture, err error) +} + +var _ DedicatedHsmClientAPI = (*hardwaresecuritymodules.DedicatedHsmClient)(nil) diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/models.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/models.go new file mode 100644 index 000000000000..a99a47d5c724 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/models.go @@ -0,0 +1,854 @@ +package hardwaresecuritymodules + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules" + +// APIEntityReference the API entity reference. +type APIEntityReference struct { + // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + ID *string `json:"id,omitempty"` +} + +// DedicatedHsm resource information with extended details. +type DedicatedHsm struct { + autorest.Response `json:"-"` + // SystemData - Metadata pertaining to creation and last modification of the resource + SystemData *SystemData `json:"systemData,omitempty"` + // DedicatedHsmProperties - Properties of the dedicated HSM + *DedicatedHsmProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The Azure Resource Manager resource ID for the dedicated HSM. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the dedicated HSM. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type of the dedicated HSM. + Type *string `json:"type,omitempty"` + // Location - The supported Azure location where the dedicated HSM should be created. + Location *string `json:"location,omitempty"` + // Sku - SKU details + Sku *Sku `json:"sku,omitempty"` + // Zones - The Dedicated Hsm zones. + Zones *[]string `json:"zones,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DedicatedHsm. +func (dh DedicatedHsm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dh.SystemData != nil { + objectMap["systemData"] = dh.SystemData + } + if dh.DedicatedHsmProperties != nil { + objectMap["properties"] = dh.DedicatedHsmProperties + } + if dh.Location != nil { + objectMap["location"] = dh.Location + } + if dh.Sku != nil { + objectMap["sku"] = dh.Sku + } + if dh.Zones != nil { + objectMap["zones"] = dh.Zones + } + if dh.Tags != nil { + objectMap["tags"] = dh.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DedicatedHsm struct. +func (dh *DedicatedHsm) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + dh.SystemData = &systemData + } + case "properties": + if v != nil { + var dedicatedHsmProperties DedicatedHsmProperties + err = json.Unmarshal(*v, &dedicatedHsmProperties) + if err != nil { + return err + } + dh.DedicatedHsmProperties = &dedicatedHsmProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dh.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dh.Location = &location + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + dh.Sku = &sku + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + dh.Zones = &zones + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dh.Tags = tags + } + } + } + + return nil +} + +// DedicatedHsmCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DedicatedHsmCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHsmClient) (DedicatedHsm, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHsmCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHsmCreateOrUpdateFuture.Result. +func (future *DedicatedHsmCreateOrUpdateFuture) result(client DedicatedHsmClient) (dh DedicatedHsm, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dh.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("hardwaresecuritymodules.DedicatedHsmCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { + dh, err = client.CreateOrUpdateResponder(dh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") + } + } + return +} + +// DedicatedHsmDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DedicatedHsmDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHsmClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHsmDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHsmDeleteFuture.Result. +func (future *DedicatedHsmDeleteFuture) result(client DedicatedHsmClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("hardwaresecuritymodules.DedicatedHsmDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DedicatedHsmError the error exception. +type DedicatedHsmError struct { + // Error - READ-ONLY; The error detail of the operation if any. + Error *Error `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHsmError. +func (dhe DedicatedHsmError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DedicatedHsmListResult list of dedicated HSMs +type DedicatedHsmListResult struct { + autorest.Response `json:"-"` + // Value - The list of dedicated HSMs. + Value *[]DedicatedHsm `json:"value,omitempty"` + // NextLink - The URL to get the next set of dedicated hsms. + NextLink *string `json:"nextLink,omitempty"` +} + +// DedicatedHsmListResultIterator provides access to a complete listing of DedicatedHsm values. +type DedicatedHsmListResultIterator struct { + i int + page DedicatedHsmListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DedicatedHsmListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DedicatedHsmListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DedicatedHsmListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DedicatedHsmListResultIterator) Response() DedicatedHsmListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DedicatedHsmListResultIterator) Value() DedicatedHsm { + if !iter.page.NotDone() { + return DedicatedHsm{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DedicatedHsmListResultIterator type. +func NewDedicatedHsmListResultIterator(page DedicatedHsmListResultPage) DedicatedHsmListResultIterator { + return DedicatedHsmListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dhlr DedicatedHsmListResult) IsEmpty() bool { + return dhlr.Value == nil || len(*dhlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dhlr DedicatedHsmListResult) hasNextLink() bool { + return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 +} + +// dedicatedHsmListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dhlr DedicatedHsmListResult) dedicatedHsmListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dhlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dhlr.NextLink))) +} + +// DedicatedHsmListResultPage contains a page of DedicatedHsm values. +type DedicatedHsmListResultPage struct { + fn func(context.Context, DedicatedHsmListResult) (DedicatedHsmListResult, error) + dhlr DedicatedHsmListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DedicatedHsmListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHsmListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dhlr) + if err != nil { + return err + } + page.dhlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DedicatedHsmListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DedicatedHsmListResultPage) NotDone() bool { + return !page.dhlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DedicatedHsmListResultPage) Response() DedicatedHsmListResult { + return page.dhlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DedicatedHsmListResultPage) Values() []DedicatedHsm { + if page.dhlr.IsEmpty() { + return nil + } + return *page.dhlr.Value +} + +// Creates a new instance of the DedicatedHsmListResultPage type. +func NewDedicatedHsmListResultPage(cur DedicatedHsmListResult, getNextPage func(context.Context, DedicatedHsmListResult) (DedicatedHsmListResult, error)) DedicatedHsmListResultPage { + return DedicatedHsmListResultPage{ + fn: getNextPage, + dhlr: cur, + } +} + +// DedicatedHsmOperation REST API operation +type DedicatedHsmOperation struct { + // Name - The name of the Dedicated HSM Resource Provider Operation. + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Gets or sets a value indicating whether it is a data plane action + IsDataAction *string `json:"isDataAction,omitempty"` + // Display - The display string. + Display *DedicatedHsmOperationDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHsmOperation. +func (dho DedicatedHsmOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dho.Name != nil { + objectMap["name"] = dho.Name + } + if dho.Display != nil { + objectMap["display"] = dho.Display + } + return json.Marshal(objectMap) +} + +// DedicatedHsmOperationDisplay the display string. +type DedicatedHsmOperationDisplay struct { + // Provider - The Resource Provider of the operation + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - The object that represents the operation. + Description *string `json:"description,omitempty"` +} + +// DedicatedHsmOperationListResult result of the request to list Dedicated HSM Provider operations. It +// contains a list of operations. +type DedicatedHsmOperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Dedicated HSM Resource Provider operations. + Value *[]DedicatedHsmOperation `json:"value,omitempty"` +} + +// DedicatedHsmPatchParameters patchable properties of the dedicated HSM +type DedicatedHsmPatchParameters struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DedicatedHsmPatchParameters. +func (dhpp DedicatedHsmPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhpp.Tags != nil { + objectMap["tags"] = dhpp.Tags + } + return json.Marshal(objectMap) +} + +// DedicatedHsmProperties properties of the dedicated hsm +type DedicatedHsmProperties struct { + // NetworkProfile - Specifies the network interfaces of the dedicated hsm. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // ManagementNetworkProfile - Specifies the management network interfaces of the dedicated hsm. + ManagementNetworkProfile *NetworkProfile `json:"managementNetworkProfile,omitempty"` + // StampID - This field will be used when RP does not support Availability zones. + StampID *string `json:"stampId,omitempty"` + // StatusMessage - READ-ONLY; Resource Status Message. + StatusMessage *string `json:"statusMessage,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state. Possible values include: 'JSONWebKeyTypeSucceeded', 'JSONWebKeyTypeProvisioning', 'JSONWebKeyTypeAllocating', 'JSONWebKeyTypeConnecting', 'JSONWebKeyTypeFailed', 'JSONWebKeyTypeCheckingQuota', 'JSONWebKeyTypeDeleting' + ProvisioningState JSONWebKeyType `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHsmProperties. +func (dhp DedicatedHsmProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhp.NetworkProfile != nil { + objectMap["networkProfile"] = dhp.NetworkProfile + } + if dhp.ManagementNetworkProfile != nil { + objectMap["managementNetworkProfile"] = dhp.ManagementNetworkProfile + } + if dhp.StampID != nil { + objectMap["stampId"] = dhp.StampID + } + return json.Marshal(objectMap) +} + +// DedicatedHsmUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DedicatedHsmUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHsmClient) (DedicatedHsm, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHsmUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHsmUpdateFuture.Result. +func (future *DedicatedHsmUpdateFuture) result(client DedicatedHsmClient) (dh DedicatedHsm, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dh.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("hardwaresecuritymodules.DedicatedHsmUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { + dh, err = client.UpdateResponder(dh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.DedicatedHsmUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") + } + } + return +} + +// EndpointDependency a domain name that dedicated hsm services are reaching at. +type EndpointDependency struct { + // DomainName - The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + // EndpointDetails - The Ports and Protocols used when connecting to domainName. + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} + +// EndpointDetail connect information from the dedicated hsm service to a single endpoint. +type EndpointDetail struct { + // IPAddress - An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + // Port - The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` + // Protocol - The protocol used for connection + Protocol *string `json:"protocol,omitempty"` + // Description - Description of the detail + Description *string `json:"description,omitempty"` +} + +// Error the key vault server error. +type Error struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // InnerError - READ-ONLY; Contains more specific error that narrows down the cause. May be null. + InnerError *Error `json:"innererror,omitempty"` +} + +// MarshalJSON is the custom marshaler for Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NetworkInterface the network interface definition. +type NetworkInterface struct { + // ID - READ-ONLY; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + ID *string `json:"id,omitempty"` + // PrivateIPAddress - Private Ip address of the interface + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkInterface. +func (ni NetworkInterface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ni.PrivateIPAddress != nil { + objectMap["privateIpAddress"] = ni.PrivateIPAddress + } + return json.Marshal(objectMap) +} + +// NetworkProfile the network profile definition. +type NetworkProfile struct { + // Subnet - Specifies the identifier of the subnet. + Subnet *APIEntityReference `json:"subnet,omitempty"` + // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM. + NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` +} + +// OutboundEnvironmentEndpoint egress endpoints which dedicated hsm service connects to for common purpose. +type OutboundEnvironmentEndpoint struct { + // Category - The category of endpoints accessed by the dedicated hsm service, e.g. azure-resource-management, apiserver, etc. + Category *string `json:"category,omitempty"` + // Endpoints - The endpoints that dedicated hsm service connects to + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` +} + +// OutboundEnvironmentEndpointCollection collection of OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundEnvironmentEndpointCollection. +func (oeec OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oeec.Value != nil { + objectMap["value"] = oeec.Value + } + return json.Marshal(objectMap) +} + +// OutboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionIterator struct { + i int + page OutboundEnvironmentEndpointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OutboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OutboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundEnvironmentEndpointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OutboundEnvironmentEndpointCollectionIterator) Response() OutboundEnvironmentEndpointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OutboundEnvironmentEndpointCollectionIterator) Value() OutboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return OutboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionIterator type. +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return OutboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oeec OutboundEnvironmentEndpointCollection) IsEmpty() bool { + return oeec.Value == nil || len(*oeec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (oeec OutboundEnvironmentEndpointCollection) hasNextLink() bool { + return oeec.NextLink != nil && len(*oeec.NextLink) != 0 +} + +// outboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oeec OutboundEnvironmentEndpointCollection) outboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !oeec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oeec.NextLink))) +} + +// OutboundEnvironmentEndpointCollectionPage contains a page of OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error) + oeec OutboundEnvironmentEndpointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OutboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.oeec) + if err != nil { + return err + } + page.oeec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OutboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.oeec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundEnvironmentEndpointCollectionPage) Response() OutboundEnvironmentEndpointCollection { + return page.oeec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundEnvironmentEndpointCollectionPage) Values() []OutboundEnvironmentEndpoint { + if page.oeec.IsEmpty() { + return nil + } + return *page.oeec.Value +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionPage type. +func NewOutboundEnvironmentEndpointCollectionPage(cur OutboundEnvironmentEndpointCollection, getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return OutboundEnvironmentEndpointCollectionPage{ + fn: getNextPage, + oeec: cur, + } +} + +// Resource dedicated HSM resource +type Resource struct { + // ID - READ-ONLY; The Azure Resource Manager resource ID for the dedicated HSM. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the dedicated HSM. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type of the dedicated HSM. + Type *string `json:"type,omitempty"` + // Location - The supported Azure location where the dedicated HSM should be created. + Location *string `json:"location,omitempty"` + // Sku - SKU details + Sku *Sku `json:"sku,omitempty"` + // Zones - The Dedicated Hsm zones. + Zones *[]string `json:"zones,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Sku != nil { + objectMap["sku"] = r.Sku + } + if r.Zones != nil { + objectMap["zones"] = r.Zones + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceListResult list of dedicated HSM resources. +type ResourceListResult struct { + // Value - The list of dedicated HSM resources. + Value *[]Resource `json:"value,omitempty"` + // NextLink - The URL to get the next set of dedicated HSM resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// Sku SKU of the dedicated HSM +type Sku struct { + // Name - SKU of the dedicated HSM. Possible values include: 'SkuNameSafeNetLunaNetworkHSMA790', 'SkuNamePayShield10KLMK1CPS60', 'SkuNamePayShield10KLMK1CPS250', 'SkuNamePayShield10KLMK1CPS2500', 'SkuNamePayShield10KLMK2CPS60', 'SkuNamePayShield10KLMK2CPS250', 'SkuNamePayShield10KLMK2CPS2500' + Name SkuName `json:"name,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of dedicated hsm resource. +type SystemData struct { + // CreatedBy - The identity that created dedicated hsm resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created dedicated hsm resource. Possible values include: 'IdentityTypeUser', 'IdentityTypeApplication', 'IdentityTypeManagedIdentity', 'IdentityTypeKey' + CreatedByType IdentityType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of dedicated hsm resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified dedicated hsm resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified dedicated hsm resource. Possible values include: 'IdentityTypeUser', 'IdentityTypeApplication', 'IdentityTypeManagedIdentity', 'IdentityTypeKey' + LastModifiedByType IdentityType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of dedicated hsm resource last modification (UTC). + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/operations.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/operations.go new file mode 100644 index 000000000000..30fb356cce57 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/operations.go @@ -0,0 +1,99 @@ +package hardwaresecuritymodules + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Azure management API provides a RESTful set of web services that interact with Azure +// Dedicated HSM RP. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List get a list of Dedicated HSM operations. +func (client OperationsClient) List(ctx context.Context) (result DedicatedHsmOperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hardwaresecuritymodules.OperationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-11-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.HardwareSecurityModules/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result DedicatedHsmOperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/version.go b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/version.go new file mode 100644 index 000000000000..bc97a8b72cb6 --- /dev/null +++ b/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules/version.go @@ -0,0 +1,19 @@ +package hardwaresecuritymodules + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " hardwaresecuritymodules/2021-11-30" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} From 476d841918b89e1ab182618c9bbaf9a41bf29300 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 14:00:35 +0800 Subject: [PATCH 5/8] Generated from specification/kubernetesconfiguration/resource-manager/readme.md tag package-2022-03 (commit hash: 61218420e95ad3435a029144877b110b56418958) --- .../kubernetesconfigurationapi/models.go | 5 +- .../mgmt/kubernetesconfiguration/models.go | 174 +- .../kubernetesconfigurationapi/models.go | 5 +- .../mgmt/kubernetesconfiguration/models.go | 174 +- .../kubernetesconfiguration/CHANGELOG.md | 2 + .../kubernetesconfiguration/_meta.json | 11 + .../kubernetesconfiguration/client.go | 41 + .../kubernetesconfiguration/enums.go | 268 ++ .../kubernetesconfiguration/extensions.go | 555 ++++ .../fluxconfigoperationstatus.go | 128 + .../fluxconfigurations.go | 557 ++++ .../kubernetesconfigurationapi/interfaces.go | 71 + .../kubernetesconfiguration/models.go | 2410 +++++++++++++++++ .../kubernetesconfiguration/operations.go | 140 + .../operationstatus.go | 260 ++ .../sourcecontrolconfigurations.go | 451 +++ .../kubernetesconfiguration/version.go | 19 + 17 files changed, 5267 insertions(+), 4 deletions(-) create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/CHANGELOG.md create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/_meta.json create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/client.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/enums.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/extensions.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigoperationstatus.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigurations.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/models.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operations.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operationstatus.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/sourcecontrolconfigurations.go create mode 100644 services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/version.go diff --git a/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go b/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go index d81d5571b511..f14ed671ce88 100644 --- a/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go +++ b/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go @@ -9,8 +9,11 @@ package kubernetesconfigurationapi -import original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2021-09-01/kubernetesconfiguration/kubernetesconfigurationapi" +import original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/kubernetesconfigurationapi" type ExtensionsClientAPI = original.ExtensionsClientAPI +type FluxConfigOperationStatusClientAPI = original.FluxConfigOperationStatusClientAPI +type FluxConfigurationsClientAPI = original.FluxConfigurationsClientAPI type OperationStatusClientAPI = original.OperationStatusClientAPI type OperationsClientAPI = original.OperationsClientAPI +type SourceControlConfigurationsClientAPI = original.SourceControlConfigurationsClientAPI diff --git a/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go b/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go index b9f7a31ecb57..ce2144a25ba9 100644 --- a/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go +++ b/profiles/latest/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go @@ -12,13 +12,30 @@ package kubernetesconfiguration import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2021-09-01/kubernetesconfiguration" + original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type AKSIdentityType = original.AKSIdentityType + +const ( + AKSIdentityTypeSystemAssigned AKSIdentityType = original.AKSIdentityTypeSystemAssigned + AKSIdentityTypeUserAssigned AKSIdentityType = original.AKSIdentityTypeUserAssigned +) + +type ComplianceStateType = original.ComplianceStateType + +const ( + ComplianceStateTypeCompliant ComplianceStateType = original.ComplianceStateTypeCompliant + ComplianceStateTypeFailed ComplianceStateType = original.ComplianceStateTypeFailed + ComplianceStateTypeInstalled ComplianceStateType = original.ComplianceStateTypeInstalled + ComplianceStateTypeNoncompliant ComplianceStateType = original.ComplianceStateTypeNoncompliant + ComplianceStateTypePending ComplianceStateType = original.ComplianceStateTypePending +) + type CreatedByType = original.CreatedByType const ( @@ -28,6 +45,24 @@ const ( CreatedByTypeUser CreatedByType = original.CreatedByTypeUser ) +type FluxComplianceState = original.FluxComplianceState + +const ( + FluxComplianceStateCompliant FluxComplianceState = original.FluxComplianceStateCompliant + FluxComplianceStateNonCompliant FluxComplianceState = original.FluxComplianceStateNonCompliant + FluxComplianceStatePending FluxComplianceState = original.FluxComplianceStatePending + FluxComplianceStateSuspended FluxComplianceState = original.FluxComplianceStateSuspended + FluxComplianceStateUnknown FluxComplianceState = original.FluxComplianceStateUnknown +) + +type KustomizationValidationType = original.KustomizationValidationType + +const ( + KustomizationValidationTypeClient KustomizationValidationType = original.KustomizationValidationTypeClient + KustomizationValidationTypeNone KustomizationValidationType = original.KustomizationValidationTypeNone + KustomizationValidationTypeServer KustomizationValidationType = original.KustomizationValidationTypeServer +) + type LevelType = original.LevelType const ( @@ -36,6 +71,27 @@ const ( LevelTypeWarning LevelType = original.LevelTypeWarning ) +type MessageLevelType = original.MessageLevelType + +const ( + MessageLevelTypeError MessageLevelType = original.MessageLevelTypeError + MessageLevelTypeInformation MessageLevelType = original.MessageLevelTypeInformation + MessageLevelTypeWarning MessageLevelType = original.MessageLevelTypeWarning +) + +type OperatorScopeType = original.OperatorScopeType + +const ( + OperatorScopeTypeCluster OperatorScopeType = original.OperatorScopeTypeCluster + OperatorScopeTypeNamespace OperatorScopeType = original.OperatorScopeTypeNamespace +) + +type OperatorType = original.OperatorType + +const ( + OperatorTypeFlux OperatorType = original.OperatorTypeFlux +) + type ProvisioningState = original.ProvisioningState const ( @@ -47,12 +103,29 @@ const ( ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating ) +type ProvisioningStateType = original.ProvisioningStateType + +const ( + ProvisioningStateTypeAccepted ProvisioningStateType = original.ProvisioningStateTypeAccepted + ProvisioningStateTypeDeleting ProvisioningStateType = original.ProvisioningStateTypeDeleting + ProvisioningStateTypeFailed ProvisioningStateType = original.ProvisioningStateTypeFailed + ProvisioningStateTypeRunning ProvisioningStateType = original.ProvisioningStateTypeRunning + ProvisioningStateTypeSucceeded ProvisioningStateType = original.ProvisioningStateTypeSucceeded +) + type ResourceIdentityType = original.ResourceIdentityType const ( ResourceIdentityTypeSystemAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssigned ) +type ScopeType = original.ScopeType + +const ( + ScopeTypeCluster ScopeType = original.ScopeTypeCluster + ScopeTypeNamespace ScopeType = original.ScopeTypeNamespace +) + type SkuTier = original.SkuTier const ( @@ -62,8 +135,18 @@ const ( SkuTierStandard SkuTier = original.SkuTierStandard ) +type SourceKindType = original.SourceKindType + +const ( + SourceKindTypeBucket SourceKindType = original.SourceKindTypeBucket + SourceKindTypeGitRepository SourceKindType = original.SourceKindTypeGitRepository +) + type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient +type BucketDefinition = original.BucketDefinition +type BucketPatchDefinition = original.BucketPatchDefinition +type ComplianceStatus = original.ComplianceStatus type ErrorAdditionalInfo = original.ErrorAdditionalInfo type ErrorDetail = original.ErrorDetail type ErrorResponse = original.ErrorResponse @@ -78,7 +161,28 @@ type ExtensionsList = original.ExtensionsList type ExtensionsListIterator = original.ExtensionsListIterator type ExtensionsListPage = original.ExtensionsListPage type ExtensionsUpdateFuture = original.ExtensionsUpdateFuture +type FluxConfigOperationStatusClient = original.FluxConfigOperationStatusClient +type FluxConfiguration = original.FluxConfiguration +type FluxConfigurationPatch = original.FluxConfigurationPatch +type FluxConfigurationPatchProperties = original.FluxConfigurationPatchProperties +type FluxConfigurationProperties = original.FluxConfigurationProperties +type FluxConfigurationsClient = original.FluxConfigurationsClient +type FluxConfigurationsCreateOrUpdateFuture = original.FluxConfigurationsCreateOrUpdateFuture +type FluxConfigurationsDeleteFuture = original.FluxConfigurationsDeleteFuture +type FluxConfigurationsList = original.FluxConfigurationsList +type FluxConfigurationsListIterator = original.FluxConfigurationsListIterator +type FluxConfigurationsListPage = original.FluxConfigurationsListPage +type FluxConfigurationsUpdateFuture = original.FluxConfigurationsUpdateFuture +type GitRepositoryDefinition = original.GitRepositoryDefinition +type GitRepositoryPatchDefinition = original.GitRepositoryPatchDefinition +type HelmOperatorProperties = original.HelmOperatorProperties +type HelmReleasePropertiesDefinition = original.HelmReleasePropertiesDefinition type Identity = original.Identity +type KustomizationDefinition = original.KustomizationDefinition +type KustomizationPatchDefinition = original.KustomizationPatchDefinition +type ObjectReferenceDefinition = original.ObjectReferenceDefinition +type ObjectStatusConditionDefinition = original.ObjectStatusConditionDefinition +type ObjectStatusDefinition = original.ObjectStatusDefinition type OperationStatusClient = original.OperationStatusClient type OperationStatusList = original.OperationStatusList type OperationStatusListIterator = original.OperationStatusListIterator @@ -89,6 +193,7 @@ type PatchExtension = original.PatchExtension type PatchExtensionProperties = original.PatchExtensionProperties type Plan = original.Plan type ProxyResource = original.ProxyResource +type RepositoryRefDefinition = original.RepositoryRefDefinition type Resource = original.Resource type ResourceModelWithAllowedPropertySet = original.ResourceModelWithAllowedPropertySet type ResourceModelWithAllowedPropertySetIdentity = original.ResourceModelWithAllowedPropertySetIdentity @@ -103,6 +208,13 @@ type Scope = original.Scope type ScopeCluster = original.ScopeCluster type ScopeNamespace = original.ScopeNamespace type Sku = original.Sku +type SourceControlConfiguration = original.SourceControlConfiguration +type SourceControlConfigurationList = original.SourceControlConfigurationList +type SourceControlConfigurationListIterator = original.SourceControlConfigurationListIterator +type SourceControlConfigurationListPage = original.SourceControlConfigurationListPage +type SourceControlConfigurationProperties = original.SourceControlConfigurationProperties +type SourceControlConfigurationsClient = original.SourceControlConfigurationsClient +type SourceControlConfigurationsDeleteFuture = original.SourceControlConfigurationsDeleteFuture type SystemData = original.SystemData type TrackedResource = original.TrackedResource @@ -121,6 +233,24 @@ func NewExtensionsListIterator(page ExtensionsListPage) ExtensionsListIterator { func NewExtensionsListPage(cur ExtensionsList, getNextPage func(context.Context, ExtensionsList) (ExtensionsList, error)) ExtensionsListPage { return original.NewExtensionsListPage(cur, getNextPage) } +func NewFluxConfigOperationStatusClient(subscriptionID string) FluxConfigOperationStatusClient { + return original.NewFluxConfigOperationStatusClient(subscriptionID) +} +func NewFluxConfigOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) FluxConfigOperationStatusClient { + return original.NewFluxConfigOperationStatusClientWithBaseURI(baseURI, subscriptionID) +} +func NewFluxConfigurationsClient(subscriptionID string) FluxConfigurationsClient { + return original.NewFluxConfigurationsClient(subscriptionID) +} +func NewFluxConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) FluxConfigurationsClient { + return original.NewFluxConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFluxConfigurationsListIterator(page FluxConfigurationsListPage) FluxConfigurationsListIterator { + return original.NewFluxConfigurationsListIterator(page) +} +func NewFluxConfigurationsListPage(cur FluxConfigurationsList, getNextPage func(context.Context, FluxConfigurationsList) (FluxConfigurationsList, error)) FluxConfigurationsListPage { + return original.NewFluxConfigurationsListPage(cur, getNextPage) +} func NewOperationStatusClient(subscriptionID string) OperationStatusClient { return original.NewOperationStatusClient(subscriptionID) } @@ -145,24 +275,66 @@ func NewResourceProviderOperationListIterator(page ResourceProviderOperationList func NewResourceProviderOperationListPage(cur ResourceProviderOperationList, getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { return original.NewResourceProviderOperationListPage(cur, getNextPage) } +func NewSourceControlConfigurationListIterator(page SourceControlConfigurationListPage) SourceControlConfigurationListIterator { + return original.NewSourceControlConfigurationListIterator(page) +} +func NewSourceControlConfigurationListPage(cur SourceControlConfigurationList, getNextPage func(context.Context, SourceControlConfigurationList) (SourceControlConfigurationList, error)) SourceControlConfigurationListPage { + return original.NewSourceControlConfigurationListPage(cur, getNextPage) +} +func NewSourceControlConfigurationsClient(subscriptionID string) SourceControlConfigurationsClient { + return original.NewSourceControlConfigurationsClient(subscriptionID) +} +func NewSourceControlConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlConfigurationsClient { + return original.NewSourceControlConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAKSIdentityTypeValues() []AKSIdentityType { + return original.PossibleAKSIdentityTypeValues() +} +func PossibleComplianceStateTypeValues() []ComplianceStateType { + return original.PossibleComplianceStateTypeValues() +} func PossibleCreatedByTypeValues() []CreatedByType { return original.PossibleCreatedByTypeValues() } +func PossibleFluxComplianceStateValues() []FluxComplianceState { + return original.PossibleFluxComplianceStateValues() +} +func PossibleKustomizationValidationTypeValues() []KustomizationValidationType { + return original.PossibleKustomizationValidationTypeValues() +} func PossibleLevelTypeValues() []LevelType { return original.PossibleLevelTypeValues() } +func PossibleMessageLevelTypeValues() []MessageLevelType { + return original.PossibleMessageLevelTypeValues() +} +func PossibleOperatorScopeTypeValues() []OperatorScopeType { + return original.PossibleOperatorScopeTypeValues() +} +func PossibleOperatorTypeValues() []OperatorType { + return original.PossibleOperatorTypeValues() +} +func PossibleProvisioningStateTypeValues() []ProvisioningStateType { + return original.PossibleProvisioningStateTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } +func PossibleScopeTypeValues() []ScopeType { + return original.PossibleScopeTypeValues() +} func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } +func PossibleSourceKindTypeValues() []SourceKindType { + return original.PossibleSourceKindTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go b/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go index d81d5571b511..f14ed671ce88 100644 --- a/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go +++ b/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/kubernetesconfigurationapi/models.go @@ -9,8 +9,11 @@ package kubernetesconfigurationapi -import original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2021-09-01/kubernetesconfiguration/kubernetesconfigurationapi" +import original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/kubernetesconfigurationapi" type ExtensionsClientAPI = original.ExtensionsClientAPI +type FluxConfigOperationStatusClientAPI = original.FluxConfigOperationStatusClientAPI +type FluxConfigurationsClientAPI = original.FluxConfigurationsClientAPI type OperationStatusClientAPI = original.OperationStatusClientAPI type OperationsClientAPI = original.OperationsClientAPI +type SourceControlConfigurationsClientAPI = original.SourceControlConfigurationsClientAPI diff --git a/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go b/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go index 98d6d2482b04..59a220e0a0e9 100644 --- a/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go +++ b/profiles/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go @@ -12,13 +12,30 @@ package kubernetesconfiguration import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2021-09-01/kubernetesconfiguration" + original "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type AKSIdentityType = original.AKSIdentityType + +const ( + AKSIdentityTypeSystemAssigned AKSIdentityType = original.AKSIdentityTypeSystemAssigned + AKSIdentityTypeUserAssigned AKSIdentityType = original.AKSIdentityTypeUserAssigned +) + +type ComplianceStateType = original.ComplianceStateType + +const ( + ComplianceStateTypeCompliant ComplianceStateType = original.ComplianceStateTypeCompliant + ComplianceStateTypeFailed ComplianceStateType = original.ComplianceStateTypeFailed + ComplianceStateTypeInstalled ComplianceStateType = original.ComplianceStateTypeInstalled + ComplianceStateTypeNoncompliant ComplianceStateType = original.ComplianceStateTypeNoncompliant + ComplianceStateTypePending ComplianceStateType = original.ComplianceStateTypePending +) + type CreatedByType = original.CreatedByType const ( @@ -28,6 +45,24 @@ const ( CreatedByTypeUser CreatedByType = original.CreatedByTypeUser ) +type FluxComplianceState = original.FluxComplianceState + +const ( + FluxComplianceStateCompliant FluxComplianceState = original.FluxComplianceStateCompliant + FluxComplianceStateNonCompliant FluxComplianceState = original.FluxComplianceStateNonCompliant + FluxComplianceStatePending FluxComplianceState = original.FluxComplianceStatePending + FluxComplianceStateSuspended FluxComplianceState = original.FluxComplianceStateSuspended + FluxComplianceStateUnknown FluxComplianceState = original.FluxComplianceStateUnknown +) + +type KustomizationValidationType = original.KustomizationValidationType + +const ( + KustomizationValidationTypeClient KustomizationValidationType = original.KustomizationValidationTypeClient + KustomizationValidationTypeNone KustomizationValidationType = original.KustomizationValidationTypeNone + KustomizationValidationTypeServer KustomizationValidationType = original.KustomizationValidationTypeServer +) + type LevelType = original.LevelType const ( @@ -36,6 +71,27 @@ const ( LevelTypeWarning LevelType = original.LevelTypeWarning ) +type MessageLevelType = original.MessageLevelType + +const ( + MessageLevelTypeError MessageLevelType = original.MessageLevelTypeError + MessageLevelTypeInformation MessageLevelType = original.MessageLevelTypeInformation + MessageLevelTypeWarning MessageLevelType = original.MessageLevelTypeWarning +) + +type OperatorScopeType = original.OperatorScopeType + +const ( + OperatorScopeTypeCluster OperatorScopeType = original.OperatorScopeTypeCluster + OperatorScopeTypeNamespace OperatorScopeType = original.OperatorScopeTypeNamespace +) + +type OperatorType = original.OperatorType + +const ( + OperatorTypeFlux OperatorType = original.OperatorTypeFlux +) + type ProvisioningState = original.ProvisioningState const ( @@ -47,12 +103,29 @@ const ( ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating ) +type ProvisioningStateType = original.ProvisioningStateType + +const ( + ProvisioningStateTypeAccepted ProvisioningStateType = original.ProvisioningStateTypeAccepted + ProvisioningStateTypeDeleting ProvisioningStateType = original.ProvisioningStateTypeDeleting + ProvisioningStateTypeFailed ProvisioningStateType = original.ProvisioningStateTypeFailed + ProvisioningStateTypeRunning ProvisioningStateType = original.ProvisioningStateTypeRunning + ProvisioningStateTypeSucceeded ProvisioningStateType = original.ProvisioningStateTypeSucceeded +) + type ResourceIdentityType = original.ResourceIdentityType const ( ResourceIdentityTypeSystemAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssigned ) +type ScopeType = original.ScopeType + +const ( + ScopeTypeCluster ScopeType = original.ScopeTypeCluster + ScopeTypeNamespace ScopeType = original.ScopeTypeNamespace +) + type SkuTier = original.SkuTier const ( @@ -62,8 +135,18 @@ const ( SkuTierStandard SkuTier = original.SkuTierStandard ) +type SourceKindType = original.SourceKindType + +const ( + SourceKindTypeBucket SourceKindType = original.SourceKindTypeBucket + SourceKindTypeGitRepository SourceKindType = original.SourceKindTypeGitRepository +) + type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient +type BucketDefinition = original.BucketDefinition +type BucketPatchDefinition = original.BucketPatchDefinition +type ComplianceStatus = original.ComplianceStatus type ErrorAdditionalInfo = original.ErrorAdditionalInfo type ErrorDetail = original.ErrorDetail type ErrorResponse = original.ErrorResponse @@ -78,7 +161,28 @@ type ExtensionsList = original.ExtensionsList type ExtensionsListIterator = original.ExtensionsListIterator type ExtensionsListPage = original.ExtensionsListPage type ExtensionsUpdateFuture = original.ExtensionsUpdateFuture +type FluxConfigOperationStatusClient = original.FluxConfigOperationStatusClient +type FluxConfiguration = original.FluxConfiguration +type FluxConfigurationPatch = original.FluxConfigurationPatch +type FluxConfigurationPatchProperties = original.FluxConfigurationPatchProperties +type FluxConfigurationProperties = original.FluxConfigurationProperties +type FluxConfigurationsClient = original.FluxConfigurationsClient +type FluxConfigurationsCreateOrUpdateFuture = original.FluxConfigurationsCreateOrUpdateFuture +type FluxConfigurationsDeleteFuture = original.FluxConfigurationsDeleteFuture +type FluxConfigurationsList = original.FluxConfigurationsList +type FluxConfigurationsListIterator = original.FluxConfigurationsListIterator +type FluxConfigurationsListPage = original.FluxConfigurationsListPage +type FluxConfigurationsUpdateFuture = original.FluxConfigurationsUpdateFuture +type GitRepositoryDefinition = original.GitRepositoryDefinition +type GitRepositoryPatchDefinition = original.GitRepositoryPatchDefinition +type HelmOperatorProperties = original.HelmOperatorProperties +type HelmReleasePropertiesDefinition = original.HelmReleasePropertiesDefinition type Identity = original.Identity +type KustomizationDefinition = original.KustomizationDefinition +type KustomizationPatchDefinition = original.KustomizationPatchDefinition +type ObjectReferenceDefinition = original.ObjectReferenceDefinition +type ObjectStatusConditionDefinition = original.ObjectStatusConditionDefinition +type ObjectStatusDefinition = original.ObjectStatusDefinition type OperationStatusClient = original.OperationStatusClient type OperationStatusList = original.OperationStatusList type OperationStatusListIterator = original.OperationStatusListIterator @@ -89,6 +193,7 @@ type PatchExtension = original.PatchExtension type PatchExtensionProperties = original.PatchExtensionProperties type Plan = original.Plan type ProxyResource = original.ProxyResource +type RepositoryRefDefinition = original.RepositoryRefDefinition type Resource = original.Resource type ResourceModelWithAllowedPropertySet = original.ResourceModelWithAllowedPropertySet type ResourceModelWithAllowedPropertySetIdentity = original.ResourceModelWithAllowedPropertySetIdentity @@ -103,6 +208,13 @@ type Scope = original.Scope type ScopeCluster = original.ScopeCluster type ScopeNamespace = original.ScopeNamespace type Sku = original.Sku +type SourceControlConfiguration = original.SourceControlConfiguration +type SourceControlConfigurationList = original.SourceControlConfigurationList +type SourceControlConfigurationListIterator = original.SourceControlConfigurationListIterator +type SourceControlConfigurationListPage = original.SourceControlConfigurationListPage +type SourceControlConfigurationProperties = original.SourceControlConfigurationProperties +type SourceControlConfigurationsClient = original.SourceControlConfigurationsClient +type SourceControlConfigurationsDeleteFuture = original.SourceControlConfigurationsDeleteFuture type SystemData = original.SystemData type TrackedResource = original.TrackedResource @@ -121,6 +233,24 @@ func NewExtensionsListIterator(page ExtensionsListPage) ExtensionsListIterator { func NewExtensionsListPage(cur ExtensionsList, getNextPage func(context.Context, ExtensionsList) (ExtensionsList, error)) ExtensionsListPage { return original.NewExtensionsListPage(cur, getNextPage) } +func NewFluxConfigOperationStatusClient(subscriptionID string) FluxConfigOperationStatusClient { + return original.NewFluxConfigOperationStatusClient(subscriptionID) +} +func NewFluxConfigOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) FluxConfigOperationStatusClient { + return original.NewFluxConfigOperationStatusClientWithBaseURI(baseURI, subscriptionID) +} +func NewFluxConfigurationsClient(subscriptionID string) FluxConfigurationsClient { + return original.NewFluxConfigurationsClient(subscriptionID) +} +func NewFluxConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) FluxConfigurationsClient { + return original.NewFluxConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewFluxConfigurationsListIterator(page FluxConfigurationsListPage) FluxConfigurationsListIterator { + return original.NewFluxConfigurationsListIterator(page) +} +func NewFluxConfigurationsListPage(cur FluxConfigurationsList, getNextPage func(context.Context, FluxConfigurationsList) (FluxConfigurationsList, error)) FluxConfigurationsListPage { + return original.NewFluxConfigurationsListPage(cur, getNextPage) +} func NewOperationStatusClient(subscriptionID string) OperationStatusClient { return original.NewOperationStatusClient(subscriptionID) } @@ -145,24 +275,66 @@ func NewResourceProviderOperationListIterator(page ResourceProviderOperationList func NewResourceProviderOperationListPage(cur ResourceProviderOperationList, getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { return original.NewResourceProviderOperationListPage(cur, getNextPage) } +func NewSourceControlConfigurationListIterator(page SourceControlConfigurationListPage) SourceControlConfigurationListIterator { + return original.NewSourceControlConfigurationListIterator(page) +} +func NewSourceControlConfigurationListPage(cur SourceControlConfigurationList, getNextPage func(context.Context, SourceControlConfigurationList) (SourceControlConfigurationList, error)) SourceControlConfigurationListPage { + return original.NewSourceControlConfigurationListPage(cur, getNextPage) +} +func NewSourceControlConfigurationsClient(subscriptionID string) SourceControlConfigurationsClient { + return original.NewSourceControlConfigurationsClient(subscriptionID) +} +func NewSourceControlConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlConfigurationsClient { + return original.NewSourceControlConfigurationsClientWithBaseURI(baseURI, subscriptionID) +} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAKSIdentityTypeValues() []AKSIdentityType { + return original.PossibleAKSIdentityTypeValues() +} +func PossibleComplianceStateTypeValues() []ComplianceStateType { + return original.PossibleComplianceStateTypeValues() +} func PossibleCreatedByTypeValues() []CreatedByType { return original.PossibleCreatedByTypeValues() } +func PossibleFluxComplianceStateValues() []FluxComplianceState { + return original.PossibleFluxComplianceStateValues() +} +func PossibleKustomizationValidationTypeValues() []KustomizationValidationType { + return original.PossibleKustomizationValidationTypeValues() +} func PossibleLevelTypeValues() []LevelType { return original.PossibleLevelTypeValues() } +func PossibleMessageLevelTypeValues() []MessageLevelType { + return original.PossibleMessageLevelTypeValues() +} +func PossibleOperatorScopeTypeValues() []OperatorScopeType { + return original.PossibleOperatorScopeTypeValues() +} +func PossibleOperatorTypeValues() []OperatorType { + return original.PossibleOperatorTypeValues() +} +func PossibleProvisioningStateTypeValues() []ProvisioningStateType { + return original.PossibleProvisioningStateTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return original.PossibleResourceIdentityTypeValues() } +func PossibleScopeTypeValues() []ScopeType { + return original.PossibleScopeTypeValues() +} func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } +func PossibleSourceKindTypeValues() []SourceKindType { + return original.PossibleSourceKindTypeValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/CHANGELOG.md b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/_meta.json b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/_meta.json new file mode 100644 index 000000000000..815367175194 --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "61218420e95ad3435a029144877b110b56418958", + "readme": "/_/azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/readme.md", + "tag": "package-2022-03", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2022-03 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/kubernetesconfiguration/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/client.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/client.go new file mode 100644 index 000000000000..87da96cd02eb --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/client.go @@ -0,0 +1,41 @@ +// Package kubernetesconfiguration implements the Azure ARM Kubernetesconfiguration service API version 2022-03-01. +// +// KubernetesConfiguration Client +package kubernetesconfiguration + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Kubernetesconfiguration + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Kubernetesconfiguration. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/enums.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/enums.go new file mode 100644 index 000000000000..74ea24bbe6fe --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/enums.go @@ -0,0 +1,268 @@ +package kubernetesconfiguration + +// 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. + +// AKSIdentityType enumerates the values for aks identity type. +type AKSIdentityType string + +const ( + // AKSIdentityTypeSystemAssigned ... + AKSIdentityTypeSystemAssigned AKSIdentityType = "SystemAssigned" + // AKSIdentityTypeUserAssigned ... + AKSIdentityTypeUserAssigned AKSIdentityType = "UserAssigned" +) + +// PossibleAKSIdentityTypeValues returns an array of possible values for the AKSIdentityType const type. +func PossibleAKSIdentityTypeValues() []AKSIdentityType { + return []AKSIdentityType{AKSIdentityTypeSystemAssigned, AKSIdentityTypeUserAssigned} +} + +// ComplianceStateType enumerates the values for compliance state type. +type ComplianceStateType string + +const ( + // ComplianceStateTypeCompliant ... + ComplianceStateTypeCompliant ComplianceStateType = "Compliant" + // ComplianceStateTypeFailed ... + ComplianceStateTypeFailed ComplianceStateType = "Failed" + // ComplianceStateTypeInstalled ... + ComplianceStateTypeInstalled ComplianceStateType = "Installed" + // ComplianceStateTypeNoncompliant ... + ComplianceStateTypeNoncompliant ComplianceStateType = "Noncompliant" + // ComplianceStateTypePending ... + ComplianceStateTypePending ComplianceStateType = "Pending" +) + +// PossibleComplianceStateTypeValues returns an array of possible values for the ComplianceStateType const type. +func PossibleComplianceStateTypeValues() []ComplianceStateType { + return []ComplianceStateType{ComplianceStateTypeCompliant, ComplianceStateTypeFailed, ComplianceStateTypeInstalled, ComplianceStateTypeNoncompliant, ComplianceStateTypePending} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// FluxComplianceState enumerates the values for flux compliance state. +type FluxComplianceState string + +const ( + // FluxComplianceStateCompliant ... + FluxComplianceStateCompliant FluxComplianceState = "Compliant" + // FluxComplianceStateNonCompliant ... + FluxComplianceStateNonCompliant FluxComplianceState = "Non-Compliant" + // FluxComplianceStatePending ... + FluxComplianceStatePending FluxComplianceState = "Pending" + // FluxComplianceStateSuspended ... + FluxComplianceStateSuspended FluxComplianceState = "Suspended" + // FluxComplianceStateUnknown ... + FluxComplianceStateUnknown FluxComplianceState = "Unknown" +) + +// PossibleFluxComplianceStateValues returns an array of possible values for the FluxComplianceState const type. +func PossibleFluxComplianceStateValues() []FluxComplianceState { + return []FluxComplianceState{FluxComplianceStateCompliant, FluxComplianceStateNonCompliant, FluxComplianceStatePending, FluxComplianceStateSuspended, FluxComplianceStateUnknown} +} + +// KustomizationValidationType enumerates the values for kustomization validation type. +type KustomizationValidationType string + +const ( + // KustomizationValidationTypeClient ... + KustomizationValidationTypeClient KustomizationValidationType = "client" + // KustomizationValidationTypeNone ... + KustomizationValidationTypeNone KustomizationValidationType = "none" + // KustomizationValidationTypeServer ... + KustomizationValidationTypeServer KustomizationValidationType = "server" +) + +// PossibleKustomizationValidationTypeValues returns an array of possible values for the KustomizationValidationType const type. +func PossibleKustomizationValidationTypeValues() []KustomizationValidationType { + return []KustomizationValidationType{KustomizationValidationTypeClient, KustomizationValidationTypeNone, KustomizationValidationTypeServer} +} + +// LevelType enumerates the values for level type. +type LevelType string + +const ( + // LevelTypeError ... + LevelTypeError LevelType = "Error" + // LevelTypeInformation ... + LevelTypeInformation LevelType = "Information" + // LevelTypeWarning ... + LevelTypeWarning LevelType = "Warning" +) + +// PossibleLevelTypeValues returns an array of possible values for the LevelType const type. +func PossibleLevelTypeValues() []LevelType { + return []LevelType{LevelTypeError, LevelTypeInformation, LevelTypeWarning} +} + +// MessageLevelType enumerates the values for message level type. +type MessageLevelType string + +const ( + // MessageLevelTypeError ... + MessageLevelTypeError MessageLevelType = "Error" + // MessageLevelTypeInformation ... + MessageLevelTypeInformation MessageLevelType = "Information" + // MessageLevelTypeWarning ... + MessageLevelTypeWarning MessageLevelType = "Warning" +) + +// PossibleMessageLevelTypeValues returns an array of possible values for the MessageLevelType const type. +func PossibleMessageLevelTypeValues() []MessageLevelType { + return []MessageLevelType{MessageLevelTypeError, MessageLevelTypeInformation, MessageLevelTypeWarning} +} + +// OperatorScopeType enumerates the values for operator scope type. +type OperatorScopeType string + +const ( + // OperatorScopeTypeCluster ... + OperatorScopeTypeCluster OperatorScopeType = "cluster" + // OperatorScopeTypeNamespace ... + OperatorScopeTypeNamespace OperatorScopeType = "namespace" +) + +// PossibleOperatorScopeTypeValues returns an array of possible values for the OperatorScopeType const type. +func PossibleOperatorScopeTypeValues() []OperatorScopeType { + return []OperatorScopeType{OperatorScopeTypeCluster, OperatorScopeTypeNamespace} +} + +// OperatorType enumerates the values for operator type. +type OperatorType string + +const ( + // OperatorTypeFlux ... + OperatorTypeFlux OperatorType = "Flux" +) + +// PossibleOperatorTypeValues returns an array of possible values for the OperatorType const type. +func PossibleOperatorTypeValues() []OperatorType { + return []OperatorType{OperatorTypeFlux} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// ProvisioningStateType enumerates the values for provisioning state type. +type ProvisioningStateType string + +const ( + // ProvisioningStateTypeAccepted ... + ProvisioningStateTypeAccepted ProvisioningStateType = "Accepted" + // ProvisioningStateTypeDeleting ... + ProvisioningStateTypeDeleting ProvisioningStateType = "Deleting" + // ProvisioningStateTypeFailed ... + ProvisioningStateTypeFailed ProvisioningStateType = "Failed" + // ProvisioningStateTypeRunning ... + ProvisioningStateTypeRunning ProvisioningStateType = "Running" + // ProvisioningStateTypeSucceeded ... + ProvisioningStateTypeSucceeded ProvisioningStateType = "Succeeded" +) + +// PossibleProvisioningStateTypeValues returns an array of possible values for the ProvisioningStateType const type. +func PossibleProvisioningStateTypeValues() []ProvisioningStateType { + return []ProvisioningStateType{ProvisioningStateTypeAccepted, ProvisioningStateTypeDeleting, ProvisioningStateTypeFailed, ProvisioningStateTypeRunning, ProvisioningStateTypeSucceeded} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeSystemAssigned} +} + +// ScopeType enumerates the values for scope type. +type ScopeType string + +const ( + // ScopeTypeCluster ... + ScopeTypeCluster ScopeType = "cluster" + // ScopeTypeNamespace ... + ScopeTypeNamespace ScopeType = "namespace" +) + +// PossibleScopeTypeValues returns an array of possible values for the ScopeType const type. +func PossibleScopeTypeValues() []ScopeType { + return []ScopeType{ScopeTypeCluster, ScopeTypeNamespace} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierFree ... + SkuTierFree SkuTier = "Free" + // SkuTierPremium ... + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierFree, SkuTierPremium, SkuTierStandard} +} + +// SourceKindType enumerates the values for source kind type. +type SourceKindType string + +const ( + // SourceKindTypeBucket ... + SourceKindTypeBucket SourceKindType = "Bucket" + // SourceKindTypeGitRepository ... + SourceKindTypeGitRepository SourceKindType = "GitRepository" +) + +// PossibleSourceKindTypeValues returns an array of possible values for the SourceKindType const type. +func PossibleSourceKindTypeValues() []SourceKindType { + return []SourceKindType{SourceKindTypeBucket, SourceKindTypeGitRepository} +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/extensions.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/extensions.go new file mode 100644 index 000000000000..f76fa8cc88a3 --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/extensions.go @@ -0,0 +1,555 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExtensionsClient is the kubernetesConfiguration Client +type ExtensionsClient struct { + BaseClient +} + +// NewExtensionsClient creates an instance of the ExtensionsClient client. +func NewExtensionsClient(subscriptionID string) ExtensionsClient { + return NewExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExtensionsClientWithBaseURI creates an instance of the ExtensionsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewExtensionsClientWithBaseURI(baseURI string, subscriptionID string) ExtensionsClient { + return ExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a new Kubernetes Cluster Extension. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// extensionName - name of the Extension. +// extension - properties necessary to Create an Extension. +func (client ExtensionsClient) Create(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, extension Extension) (result ExtensionsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.ExtensionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, extension) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ExtensionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, extension Extension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", pathParameters), + autorest.WithJSON(extension), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) CreateSender(req *http.Request) (future ExtensionsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) CreateResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a Kubernetes Cluster Extension. This will cause the Agent to Uninstall the extension from the cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// extensionName - name of the Extension. +// forceDelete - delete the extension resource in Azure - not the normal asynchronous delete. +func (client ExtensionsClient) Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, forceDelete *bool) (result ExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.ExtensionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, forceDelete) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, forceDelete *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDelete != nil { + queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) DeleteSender(req *http.Request) (future ExtensionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets Kubernetes Cluster Extension. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// extensionName - name of the Extension. +func (client ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string) (result Extension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.ExtensionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) GetResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all Extensions in the cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +func (client ExtensionsClient) List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result ExtensionsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.List") + defer func() { + sc := -1 + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.ExtensionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.el.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "List", resp, "Failure sending request") + return + } + + result.el, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "List", resp, "Failure responding to request") + return + } + if result.el.hasNextLink() && result.el.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) ListResponder(resp *http.Response) (result ExtensionsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ExtensionsClient) listNextResults(ctx context.Context, lastResults ExtensionsList) (result ExtensionsList, err error) { + req, err := lastResults.extensionsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result ExtensionsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + return +} + +// Update patch an existing Kubernetes Cluster Extension. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// extensionName - name of the Extension. +// patchExtension - properties to Patch in an existing Extension. +func (client ExtensionsClient) Update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, patchExtension PatchExtension) (result ExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.ExtensionsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, patchExtension) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, patchExtension PatchExtension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "extensionName": autorest.Encode("path", extensionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}", pathParameters), + autorest.WithJSON(patchExtension), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ExtensionsClient) UpdateSender(req *http.Request) (future ExtensionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ExtensionsClient) UpdateResponder(resp *http.Response) (result Extension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigoperationstatus.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigoperationstatus.go new file mode 100644 index 000000000000..c7520684848d --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigoperationstatus.go @@ -0,0 +1,128 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// FluxConfigOperationStatusClient is the kubernetesConfiguration Client +type FluxConfigOperationStatusClient struct { + BaseClient +} + +// NewFluxConfigOperationStatusClient creates an instance of the FluxConfigOperationStatusClient client. +func NewFluxConfigOperationStatusClient(subscriptionID string) FluxConfigOperationStatusClient { + return NewFluxConfigOperationStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFluxConfigOperationStatusClientWithBaseURI creates an instance of the FluxConfigOperationStatusClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewFluxConfigOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) FluxConfigOperationStatusClient { + return FluxConfigOperationStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get Async Operation status +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// fluxConfigurationName - name of the Flux Configuration. +// operationID - operation Id +func (client FluxConfigOperationStatusClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, operationID string) (result OperationStatusResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigOperationStatusClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.FluxConfigOperationStatusClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigOperationStatusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigOperationStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigOperationStatusClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client FluxConfigOperationStatusClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "fluxConfigurationName": autorest.Encode("path", fluxConfigurationName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client FluxConfigOperationStatusClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client FluxConfigOperationStatusClient) GetResponder(resp *http.Response) (result OperationStatusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigurations.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigurations.go new file mode 100644 index 000000000000..ca2c8a1596fd --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/fluxconfigurations.go @@ -0,0 +1,557 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// FluxConfigurationsClient is the kubernetesConfiguration Client +type FluxConfigurationsClient struct { + BaseClient +} + +// NewFluxConfigurationsClient creates an instance of the FluxConfigurationsClient client. +func NewFluxConfigurationsClient(subscriptionID string) FluxConfigurationsClient { + return NewFluxConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFluxConfigurationsClientWithBaseURI creates an instance of the FluxConfigurationsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewFluxConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) FluxConfigurationsClient { + return FluxConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a new Kubernetes Flux Configuration. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// fluxConfigurationName - name of the Flux Configuration. +// fluxConfiguration - properties necessary to Create a FluxConfiguration. +func (client FluxConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfiguration FluxConfiguration) (result FluxConfigurationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.FluxConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client FluxConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfiguration FluxConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "fluxConfigurationName": autorest.Encode("path", fluxConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", pathParameters), + autorest.WithJSON(fluxConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client FluxConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future FluxConfigurationsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client FluxConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result FluxConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete this will delete the YAML file used to set up the Flux Configuration, thus stopping future sync from the +// source repo. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// fluxConfigurationName - name of the Flux Configuration. +// forceDelete - delete the extension resource in Azure - not the normal asynchronous delete. +func (client FluxConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, forceDelete *bool) (result FluxConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.FluxConfigurationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, forceDelete) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FluxConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, forceDelete *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "fluxConfigurationName": autorest.Encode("path", fluxConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDelete != nil { + queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client FluxConfigurationsClient) DeleteSender(req *http.Request) (future FluxConfigurationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FluxConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets details of the Flux Configuration. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// fluxConfigurationName - name of the Flux Configuration. +func (client FluxConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string) (result FluxConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.FluxConfigurationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client FluxConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "fluxConfigurationName": autorest.Encode("path", fluxConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client FluxConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client FluxConfigurationsClient) GetResponder(resp *http.Response) (result FluxConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all Flux Configurations. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +func (client FluxConfigurationsClient) List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result FluxConfigurationsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsClient.List") + defer func() { + sc := -1 + if result.fcl.Response.Response != nil { + sc = result.fcl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.FluxConfigurationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.fcl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result.fcl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.fcl.hasNextLink() && result.fcl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client FluxConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client FluxConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client FluxConfigurationsClient) ListResponder(resp *http.Response) (result FluxConfigurationsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client FluxConfigurationsClient) listNextResults(ctx context.Context, lastResults FluxConfigurationsList) (result FluxConfigurationsList, err error) { + req, err := lastResults.fluxConfigurationsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client FluxConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result FluxConfigurationsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + return +} + +// Update update an existing Kubernetes Flux Configuration. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// fluxConfigurationName - name of the Flux Configuration. +// fluxConfigurationPatch - properties to Patch in an existing Flux Configuration. +func (client FluxConfigurationsClient) Update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfigurationPatch FluxConfigurationPatch) (result FluxConfigurationsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.FluxConfigurationsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, fluxConfigurationName, fluxConfigurationPatch) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client FluxConfigurationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfigurationPatch FluxConfigurationPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "fluxConfigurationName": autorest.Encode("path", fluxConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/{fluxConfigurationName}", pathParameters), + autorest.WithJSON(fluxConfigurationPatch), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client FluxConfigurationsClient) UpdateSender(req *http.Request) (future FluxConfigurationsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client FluxConfigurationsClient) UpdateResponder(resp *http.Response) (result FluxConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go new file mode 100644 index 000000000000..d9863a59740e --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go @@ -0,0 +1,71 @@ +package kubernetesconfigurationapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration" +) + +// ExtensionsClientAPI contains the set of methods on the ExtensionsClient type. +type ExtensionsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, extension kubernetesconfiguration.Extension) (result kubernetesconfiguration.ExtensionsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, forceDelete *bool) (result kubernetesconfiguration.ExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string) (result kubernetesconfiguration.Extension, err error) + List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.ExtensionsListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.ExtensionsListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, patchExtension kubernetesconfiguration.PatchExtension) (result kubernetesconfiguration.ExtensionsUpdateFuture, err error) +} + +var _ ExtensionsClientAPI = (*kubernetesconfiguration.ExtensionsClient)(nil) + +// OperationStatusClientAPI contains the set of methods on the OperationStatusClient type. +type OperationStatusClientAPI interface { + Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, operationID string) (result kubernetesconfiguration.OperationStatusResult, err error) + List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.OperationStatusListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.OperationStatusListIterator, err error) +} + +var _ OperationStatusClientAPI = (*kubernetesconfiguration.OperationStatusClient)(nil) + +// FluxConfigurationsClientAPI contains the set of methods on the FluxConfigurationsClient type. +type FluxConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfiguration kubernetesconfiguration.FluxConfiguration) (result kubernetesconfiguration.FluxConfigurationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, forceDelete *bool) (result kubernetesconfiguration.FluxConfigurationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string) (result kubernetesconfiguration.FluxConfiguration, err error) + List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.FluxConfigurationsListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.FluxConfigurationsListIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, fluxConfigurationPatch kubernetesconfiguration.FluxConfigurationPatch) (result kubernetesconfiguration.FluxConfigurationsUpdateFuture, err error) +} + +var _ FluxConfigurationsClientAPI = (*kubernetesconfiguration.FluxConfigurationsClient)(nil) + +// FluxConfigOperationStatusClientAPI contains the set of methods on the FluxConfigOperationStatusClient type. +type FluxConfigOperationStatusClientAPI interface { + Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, fluxConfigurationName string, operationID string) (result kubernetesconfiguration.OperationStatusResult, err error) +} + +var _ FluxConfigOperationStatusClientAPI = (*kubernetesconfiguration.FluxConfigOperationStatusClient)(nil) + +// SourceControlConfigurationsClientAPI contains the set of methods on the SourceControlConfigurationsClient type. +type SourceControlConfigurationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration kubernetesconfiguration.SourceControlConfiguration) (result kubernetesconfiguration.SourceControlConfiguration, err error) + Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result kubernetesconfiguration.SourceControlConfigurationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result kubernetesconfiguration.SourceControlConfiguration, err error) + List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.SourceControlConfigurationListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.SourceControlConfigurationListIterator, err error) +} + +var _ SourceControlConfigurationsClientAPI = (*kubernetesconfiguration.SourceControlConfigurationsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result kubernetesconfiguration.ResourceProviderOperationListPage, err error) + ListComplete(ctx context.Context) (result kubernetesconfiguration.ResourceProviderOperationListIterator, err error) +} + +var _ OperationsClientAPI = (*kubernetesconfiguration.OperationsClient)(nil) diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/models.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/models.go new file mode 100644 index 000000000000..f807127ecb8a --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/models.go @@ -0,0 +1,2410 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration" + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BucketDefinition parameters to reconcile to the GitRepository source kind type. +type BucketDefinition struct { + // URL - The URL to sync for the flux configuration S3 bucket. + URL *string `json:"url,omitempty"` + // BucketName - The bucket name to sync from the url endpoint for the flux configuration. + BucketName *string `json:"bucketName,omitempty"` + // Insecure - Specify whether to use insecure communication when puling data from the S3 bucket. + Insecure *bool `json:"insecure,omitempty"` + // TimeoutInSeconds - The maximum time to attempt to reconcile the cluster git repository source with the remote. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + // SyncIntervalInSeconds - The interval at which to re-reconcile the cluster git repository source with the remote. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + // AccessKey - Plaintext access key used to securely access the S3 bucket + AccessKey *string `json:"accessKey,omitempty"` + // LocalAuthRef - Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. + LocalAuthRef *string `json:"localAuthRef,omitempty"` +} + +// BucketPatchDefinition parameters to reconcile to the GitRepository source kind type. +type BucketPatchDefinition struct { + // URL - The URL to sync for the flux configuration S3 bucket. + URL *string `json:"url,omitempty"` + // BucketName - The bucket name to sync from the url endpoint for the flux configuration. + BucketName *string `json:"bucketName,omitempty"` + // Insecure - Specify whether to use insecure communication when puling data from the S3 bucket. + Insecure *bool `json:"insecure,omitempty"` + // TimeoutInSeconds - The maximum time to attempt to reconcile the cluster git repository source with the remote. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + // SyncIntervalInSeconds - The interval at which to re-reconcile the cluster git repository source with the remote. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + // AccessKey - Plaintext access key used to securely access the S3 bucket + AccessKey *string `json:"accessKey,omitempty"` + // LocalAuthRef - Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. + LocalAuthRef *string `json:"localAuthRef,omitempty"` +} + +// ComplianceStatus compliance Status details +type ComplianceStatus struct { + // ComplianceState - READ-ONLY; The compliance state of the configuration. Possible values include: 'ComplianceStateTypePending', 'ComplianceStateTypeCompliant', 'ComplianceStateTypeNoncompliant', 'ComplianceStateTypeInstalled', 'ComplianceStateTypeFailed' + ComplianceState ComplianceStateType `json:"complianceState,omitempty"` + // LastConfigApplied - Datetime the configuration was last applied. + LastConfigApplied *date.Time `json:"lastConfigApplied,omitempty"` + // Message - Message from when the configuration was applied. + Message *string `json:"message,omitempty"` + // MessageLevel - Level of the message. Possible values include: 'MessageLevelTypeError', 'MessageLevelTypeWarning', 'MessageLevelTypeInformation' + MessageLevel MessageLevelType `json:"messageLevel,omitempty"` +} + +// MarshalJSON is the custom marshaler for ComplianceStatus. +func (cs ComplianceStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.LastConfigApplied != nil { + objectMap["lastConfigApplied"] = cs.LastConfigApplied + } + if cs.Message != nil { + objectMap["message"] = cs.Message + } + if cs.MessageLevel != "" { + objectMap["messageLevel"] = cs.MessageLevel + } + return json.Marshal(objectMap) +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// Extension the Extension object. +type Extension struct { + autorest.Response `json:"-"` + // ExtensionProperties - Properties of an Extension resource + *ExtensionProperties `json:"properties,omitempty"` + // Identity - Identity of the Extension resource + Identity *Identity `json:"identity,omitempty"` + // SystemData - Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Extension. +func (e Extension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExtensionProperties != nil { + objectMap["properties"] = e.ExtensionProperties + } + if e.Identity != nil { + objectMap["identity"] = e.Identity + } + if e.SystemData != nil { + objectMap["systemData"] = e.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Extension struct. +func (e *Extension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var extensionProperties ExtensionProperties + err = json.Unmarshal(*v, &extensionProperties) + if err != nil { + return err + } + e.ExtensionProperties = &extensionProperties + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + e.Identity = &identity + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + e.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + } + } + + return nil +} + +// ExtensionProperties properties of an Extension resource +type ExtensionProperties struct { + // ExtensionType - Type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + ExtensionType *string `json:"extensionType,omitempty"` + // AutoUpgradeMinorVersion - Flag to note if this extension participates in auto upgrade of minor version, or not. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // ReleaseTrain - ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + ReleaseTrain *string `json:"releaseTrain,omitempty"` + // Version - User-specified version of the extension for this extension to 'pin'. To use 'version', autoUpgradeMinorVersion must be 'false'. + Version *string `json:"version,omitempty"` + // Scope - Scope at which the extension is installed. + Scope *Scope `json:"scope,omitempty"` + // ConfigurationSettings - Configuration settings, as name-value pairs for configuring this extension. + ConfigurationSettings map[string]*string `json:"configurationSettings"` + // ConfigurationProtectedSettings - Configuration settings that are sensitive, as name-value pairs for configuring this extension. + ConfigurationProtectedSettings map[string]*string `json:"configurationProtectedSettings"` + // InstalledVersion - READ-ONLY; Installed version of the extension. + InstalledVersion *string `json:"installedVersion,omitempty"` + // ProvisioningState - READ-ONLY; Status of installation of this extension. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Statuses - Status from this extension. + Statuses *[]ExtensionStatus `json:"statuses,omitempty"` + // ErrorInfo - READ-ONLY; Error information from the Agent - e.g. errors during installation. + ErrorInfo *ErrorDetail `json:"errorInfo,omitempty"` + // CustomLocationSettings - READ-ONLY; Custom Location settings properties. + CustomLocationSettings map[string]*string `json:"customLocationSettings"` + // PackageURI - READ-ONLY; Uri of the Helm package + PackageURI *string `json:"packageUri,omitempty"` + // AksAssignedIdentity - Identity of the Extension resource in an AKS cluster + AksAssignedIdentity *ExtensionPropertiesAksAssignedIdentity `json:"aksAssignedIdentity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionProperties. +func (e ExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExtensionType != nil { + objectMap["extensionType"] = e.ExtensionType + } + if e.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = e.AutoUpgradeMinorVersion + } + if e.ReleaseTrain != nil { + objectMap["releaseTrain"] = e.ReleaseTrain + } + if e.Version != nil { + objectMap["version"] = e.Version + } + if e.Scope != nil { + objectMap["scope"] = e.Scope + } + if e.ConfigurationSettings != nil { + objectMap["configurationSettings"] = e.ConfigurationSettings + } + if e.ConfigurationProtectedSettings != nil { + objectMap["configurationProtectedSettings"] = e.ConfigurationProtectedSettings + } + if e.Statuses != nil { + objectMap["statuses"] = e.Statuses + } + if e.AksAssignedIdentity != nil { + objectMap["aksAssignedIdentity"] = e.AksAssignedIdentity + } + return json.Marshal(objectMap) +} + +// ExtensionPropertiesAksAssignedIdentity identity of the Extension resource in an AKS cluster +type ExtensionPropertiesAksAssignedIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'AKSIdentityTypeSystemAssigned', 'AKSIdentityTypeUserAssigned' + Type AKSIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionPropertiesAksAssignedIdentity. +func (eAi ExtensionPropertiesAksAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eAi.Type != "" { + objectMap["type"] = eAi.Type + } + return json.Marshal(objectMap) +} + +// ExtensionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (Extension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsCreateFuture.Result. +func (future *ExtensionsCreateFuture) result(client ExtensionsClient) (e Extension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + e.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.ExtensionsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsCreateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsDeleteFuture.Result. +func (future *ExtensionsDeleteFuture) result(client ExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.ExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExtensionsList result of the request to list Extensions. It contains a list of Extension objects and a +// URL link to get the next set of results. +type ExtensionsList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Extensions within a Kubernetes cluster. + Value *[]Extension `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of extension objects, if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtensionsList. +func (el ExtensionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ExtensionsListIterator provides access to a complete listing of Extension values. +type ExtensionsListIterator struct { + i int + page ExtensionsListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ExtensionsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ExtensionsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtensionsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ExtensionsListIterator) Response() ExtensionsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ExtensionsListIterator) Value() Extension { + if !iter.page.NotDone() { + return Extension{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtensionsListIterator type. +func NewExtensionsListIterator(page ExtensionsListPage) ExtensionsListIterator { + return ExtensionsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el ExtensionsList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (el ExtensionsList) hasNextLink() bool { + return el.NextLink != nil && len(*el.NextLink) != 0 +} + +// extensionsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el ExtensionsList) extensionsListPreparer(ctx context.Context) (*http.Request, error) { + if !el.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// ExtensionsListPage contains a page of Extension values. +type ExtensionsListPage struct { + fn func(context.Context, ExtensionsList) (ExtensionsList, error) + el ExtensionsList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ExtensionsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtensionsListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ExtensionsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtensionsListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtensionsListPage) Response() ExtensionsList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtensionsListPage) Values() []Extension { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the ExtensionsListPage type. +func NewExtensionsListPage(cur ExtensionsList, getNextPage func(context.Context, ExtensionsList) (ExtensionsList, error)) ExtensionsListPage { + return ExtensionsListPage{ + fn: getNextPage, + el: cur, + } +} + +// ExtensionStatus status from the extension. +type ExtensionStatus struct { + // Code - Status code provided by the Extension + Code *string `json:"code,omitempty"` + // DisplayStatus - Short description of status of the extension. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Level - Level of the status. Possible values include: 'LevelTypeError', 'LevelTypeWarning', 'LevelTypeInformation' + Level LevelType `json:"level,omitempty"` + // Message - Detailed message of the status from the Extension. + Message *string `json:"message,omitempty"` + // Time - DateLiteral (per ISO8601) noting the time of installation status. + Time *string `json:"time,omitempty"` +} + +// ExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExtensionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ExtensionsClient) (Extension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ExtensionsUpdateFuture.Result. +func (future *ExtensionsUpdateFuture) result(client ExtensionsClient) (e Extension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + e.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.ExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.ExtensionsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// FluxConfiguration the Flux Configuration object returned in Get & Put response. +type FluxConfiguration struct { + autorest.Response `json:"-"` + // FluxConfigurationProperties - Properties to create a Flux Configuration resource + *FluxConfigurationProperties `json:"properties,omitempty"` + // SystemData - Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FluxConfiguration. +func (fc FluxConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fc.FluxConfigurationProperties != nil { + objectMap["properties"] = fc.FluxConfigurationProperties + } + if fc.SystemData != nil { + objectMap["systemData"] = fc.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FluxConfiguration struct. +func (fc *FluxConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var fluxConfigurationProperties FluxConfigurationProperties + err = json.Unmarshal(*v, &fluxConfigurationProperties) + if err != nil { + return err + } + fc.FluxConfigurationProperties = &fluxConfigurationProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + fc.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fc.Type = &typeVar + } + } + } + + return nil +} + +// FluxConfigurationPatch the Flux Configuration Patch Request object. +type FluxConfigurationPatch struct { + // FluxConfigurationPatchProperties - Updatable properties of an Flux Configuration Patch Request + *FluxConfigurationPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for FluxConfigurationPatch. +func (fcp FluxConfigurationPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fcp.FluxConfigurationPatchProperties != nil { + objectMap["properties"] = fcp.FluxConfigurationPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FluxConfigurationPatch struct. +func (fcp *FluxConfigurationPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var fluxConfigurationPatchProperties FluxConfigurationPatchProperties + err = json.Unmarshal(*v, &fluxConfigurationPatchProperties) + if err != nil { + return err + } + fcp.FluxConfigurationPatchProperties = &fluxConfigurationPatchProperties + } + } + } + + return nil +} + +// FluxConfigurationPatchProperties updatable properties of an Flux Configuration Patch Request +type FluxConfigurationPatchProperties struct { + // SourceKind - Source Kind to pull the configuration data from. Possible values include: 'SourceKindTypeGitRepository', 'SourceKindTypeBucket' + SourceKind SourceKindType `json:"sourceKind,omitempty"` + // Suspend - Whether this configuration should suspend its reconciliation of its kustomizations and sources. + Suspend *bool `json:"suspend,omitempty"` + // GitRepository - Parameters to reconcile to the GitRepository source kind type. + GitRepository *GitRepositoryPatchDefinition `json:"gitRepository,omitempty"` + // Bucket - Parameters to reconcile to the Bucket source kind type. + Bucket *BucketPatchDefinition `json:"bucket,omitempty"` + // Kustomizations - Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. + Kustomizations map[string]*KustomizationPatchDefinition `json:"kustomizations"` + // ConfigurationProtectedSettings - Key-value pairs of protected configuration settings for the configuration + ConfigurationProtectedSettings map[string]*string `json:"configurationProtectedSettings"` +} + +// MarshalJSON is the custom marshaler for FluxConfigurationPatchProperties. +func (fcp FluxConfigurationPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fcp.SourceKind != "" { + objectMap["sourceKind"] = fcp.SourceKind + } + if fcp.Suspend != nil { + objectMap["suspend"] = fcp.Suspend + } + if fcp.GitRepository != nil { + objectMap["gitRepository"] = fcp.GitRepository + } + if fcp.Bucket != nil { + objectMap["bucket"] = fcp.Bucket + } + if fcp.Kustomizations != nil { + objectMap["kustomizations"] = fcp.Kustomizations + } + if fcp.ConfigurationProtectedSettings != nil { + objectMap["configurationProtectedSettings"] = fcp.ConfigurationProtectedSettings + } + return json.Marshal(objectMap) +} + +// FluxConfigurationProperties properties to create a Flux Configuration resource +type FluxConfigurationProperties struct { + // Scope - Scope at which the operator will be installed. Possible values include: 'ScopeTypeCluster', 'ScopeTypeNamespace' + Scope ScopeType `json:"scope,omitempty"` + // Namespace - The namespace to which this configuration is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only. + Namespace *string `json:"namespace,omitempty"` + // SourceKind - Source Kind to pull the configuration data from. Possible values include: 'SourceKindTypeGitRepository', 'SourceKindTypeBucket' + SourceKind SourceKindType `json:"sourceKind,omitempty"` + // Suspend - Whether this configuration should suspend its reconciliation of its kustomizations and sources. + Suspend *bool `json:"suspend,omitempty"` + // GitRepository - Parameters to reconcile to the GitRepository source kind type. + GitRepository *GitRepositoryDefinition `json:"gitRepository,omitempty"` + // Bucket - Parameters to reconcile to the Bucket source kind type. + Bucket *BucketDefinition `json:"bucket,omitempty"` + // Kustomizations - Array of kustomizations used to reconcile the artifact pulled by the source type on the cluster. + Kustomizations map[string]*KustomizationDefinition `json:"kustomizations"` + // ConfigurationProtectedSettings - Key-value pairs of protected configuration settings for the configuration + ConfigurationProtectedSettings map[string]*string `json:"configurationProtectedSettings"` + // Statuses - READ-ONLY; Statuses of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects provisioned by the fluxConfiguration. + Statuses *[]ObjectStatusDefinition `json:"statuses,omitempty"` + // RepositoryPublicKey - READ-ONLY; Public Key associated with this fluxConfiguration (either generated within the cluster or provided by the user). + RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` + // SourceSyncedCommitID - READ-ONLY; Branch and/or SHA of the source commit synced with the cluster. + SourceSyncedCommitID *string `json:"sourceSyncedCommitId,omitempty"` + // SourceUpdatedAt - READ-ONLY; Datetime the fluxConfiguration synced its source on the cluster. + SourceUpdatedAt *date.Time `json:"sourceUpdatedAt,omitempty"` + // StatusUpdatedAt - READ-ONLY; Datetime the fluxConfiguration synced its status on the cluster with Azure. + StatusUpdatedAt *date.Time `json:"statusUpdatedAt,omitempty"` + // ComplianceState - READ-ONLY; Combined status of the Flux Kubernetes resources created by the fluxConfiguration or created by the managed objects. Possible values include: 'FluxComplianceStateCompliant', 'FluxComplianceStateNonCompliant', 'FluxComplianceStatePending', 'FluxComplianceStateSuspended', 'FluxComplianceStateUnknown' + ComplianceState FluxComplianceState `json:"complianceState,omitempty"` + // ProvisioningState - READ-ONLY; Status of the creation of the fluxConfiguration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ErrorMessage - READ-ONLY; Error message returned to the user in the case of provisioning failure. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for FluxConfigurationProperties. +func (fc FluxConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fc.Scope != "" { + objectMap["scope"] = fc.Scope + } + if fc.Namespace != nil { + objectMap["namespace"] = fc.Namespace + } + if fc.SourceKind != "" { + objectMap["sourceKind"] = fc.SourceKind + } + if fc.Suspend != nil { + objectMap["suspend"] = fc.Suspend + } + if fc.GitRepository != nil { + objectMap["gitRepository"] = fc.GitRepository + } + if fc.Bucket != nil { + objectMap["bucket"] = fc.Bucket + } + if fc.Kustomizations != nil { + objectMap["kustomizations"] = fc.Kustomizations + } + if fc.ConfigurationProtectedSettings != nil { + objectMap["configurationProtectedSettings"] = fc.ConfigurationProtectedSettings + } + return json.Marshal(objectMap) +} + +// FluxConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FluxConfigurationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FluxConfigurationsClient) (FluxConfiguration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FluxConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FluxConfigurationsCreateOrUpdateFuture.Result. +func (future *FluxConfigurationsCreateOrUpdateFuture) result(client FluxConfigurationsClient) (fc FluxConfiguration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + fc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.FluxConfigurationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fc.Response.Response, err = future.GetResult(sender); err == nil && fc.Response.Response.StatusCode != http.StatusNoContent { + fc, err = client.CreateOrUpdateResponder(fc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsCreateOrUpdateFuture", "Result", fc.Response.Response, "Failure responding to request") + } + } + return +} + +// FluxConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FluxConfigurationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FluxConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FluxConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FluxConfigurationsDeleteFuture.Result. +func (future *FluxConfigurationsDeleteFuture) result(client FluxConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.FluxConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// FluxConfigurationsList result of the request to list Flux Configurations. It contains a list of +// FluxConfiguration objects and a URL link to get the next set of results. +type FluxConfigurationsList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Flux Configurations within a Kubernetes cluster. + Value *[]FluxConfiguration `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of configuration objects, if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for FluxConfigurationsList. +func (fcl FluxConfigurationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FluxConfigurationsListIterator provides access to a complete listing of FluxConfiguration values. +type FluxConfigurationsListIterator struct { + i int + page FluxConfigurationsListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FluxConfigurationsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FluxConfigurationsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FluxConfigurationsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FluxConfigurationsListIterator) Response() FluxConfigurationsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FluxConfigurationsListIterator) Value() FluxConfiguration { + if !iter.page.NotDone() { + return FluxConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FluxConfigurationsListIterator type. +func NewFluxConfigurationsListIterator(page FluxConfigurationsListPage) FluxConfigurationsListIterator { + return FluxConfigurationsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fcl FluxConfigurationsList) IsEmpty() bool { + return fcl.Value == nil || len(*fcl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fcl FluxConfigurationsList) hasNextLink() bool { + return fcl.NextLink != nil && len(*fcl.NextLink) != 0 +} + +// fluxConfigurationsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fcl FluxConfigurationsList) fluxConfigurationsListPreparer(ctx context.Context) (*http.Request, error) { + if !fcl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fcl.NextLink))) +} + +// FluxConfigurationsListPage contains a page of FluxConfiguration values. +type FluxConfigurationsListPage struct { + fn func(context.Context, FluxConfigurationsList) (FluxConfigurationsList, error) + fcl FluxConfigurationsList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FluxConfigurationsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FluxConfigurationsListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fcl) + if err != nil { + return err + } + page.fcl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FluxConfigurationsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FluxConfigurationsListPage) NotDone() bool { + return !page.fcl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FluxConfigurationsListPage) Response() FluxConfigurationsList { + return page.fcl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FluxConfigurationsListPage) Values() []FluxConfiguration { + if page.fcl.IsEmpty() { + return nil + } + return *page.fcl.Value +} + +// Creates a new instance of the FluxConfigurationsListPage type. +func NewFluxConfigurationsListPage(cur FluxConfigurationsList, getNextPage func(context.Context, FluxConfigurationsList) (FluxConfigurationsList, error)) FluxConfigurationsListPage { + return FluxConfigurationsListPage{ + fn: getNextPage, + fcl: cur, + } +} + +// FluxConfigurationsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FluxConfigurationsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FluxConfigurationsClient) (FluxConfiguration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FluxConfigurationsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FluxConfigurationsUpdateFuture.Result. +func (future *FluxConfigurationsUpdateFuture) result(client FluxConfigurationsClient) (fc FluxConfiguration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + fc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.FluxConfigurationsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fc.Response.Response, err = future.GetResult(sender); err == nil && fc.Response.Response.StatusCode != http.StatusNoContent { + fc, err = client.UpdateResponder(fc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.FluxConfigurationsUpdateFuture", "Result", fc.Response.Response, "Failure responding to request") + } + } + return +} + +// GitRepositoryDefinition parameters to reconcile to the GitRepository source kind type. +type GitRepositoryDefinition struct { + // URL - The URL to sync for the flux configuration git repository. + URL *string `json:"url,omitempty"` + // TimeoutInSeconds - The maximum time to attempt to reconcile the cluster git repository source with the remote. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + // SyncIntervalInSeconds - The interval at which to re-reconcile the cluster git repository source with the remote. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + // RepositoryRef - The source reference for the GitRepository object. + RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"` + // SSHKnownHosts - Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH + SSHKnownHosts *string `json:"sshKnownHosts,omitempty"` + // HTTPSUser - Plaintext HTTPS username used to access private git repositories over HTTPS + HTTPSUser *string `json:"httpsUser,omitempty"` + // HTTPSCACert - Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS + HTTPSCACert *string `json:"httpsCACert,omitempty"` + // LocalAuthRef - Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. + LocalAuthRef *string `json:"localAuthRef,omitempty"` +} + +// GitRepositoryPatchDefinition parameters to reconcile to the GitRepository source kind type. +type GitRepositoryPatchDefinition struct { + // URL - The URL to sync for the flux configuration git repository. + URL *string `json:"url,omitempty"` + // TimeoutInSeconds - The maximum time to attempt to reconcile the cluster git repository source with the remote. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + // SyncIntervalInSeconds - The interval at which to re-reconcile the cluster git repository source with the remote. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + // RepositoryRef - The source reference for the GitRepository object. + RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"` + // SSHKnownHosts - Base64-encoded known_hosts value containing public SSH keys required to access private git repositories over SSH + SSHKnownHosts *string `json:"sshKnownHosts,omitempty"` + // HTTPSUser - Plaintext HTTPS username used to access private git repositories over HTTPS + HTTPSUser *string `json:"httpsUser,omitempty"` + // HTTPSCACert - Base64-encoded HTTPS certificate authority contents used to access git private git repositories over HTTPS + HTTPSCACert *string `json:"httpsCACert,omitempty"` + // LocalAuthRef - Name of a local secret on the Kubernetes cluster to use as the authentication secret rather than the managed or user-provided configuration secrets. + LocalAuthRef *string `json:"localAuthRef,omitempty"` +} + +// HelmOperatorProperties properties for Helm operator. +type HelmOperatorProperties struct { + // ChartVersion - Version of the operator Helm chart. + ChartVersion *string `json:"chartVersion,omitempty"` + // ChartValues - Values override for the operator Helm chart. + ChartValues *string `json:"chartValues,omitempty"` +} + +// HelmReleasePropertiesDefinition properties for HelmRelease objects +type HelmReleasePropertiesDefinition struct { + // LastRevisionApplied - The revision number of the last released object change + LastRevisionApplied *int64 `json:"lastRevisionApplied,omitempty"` + // HelmChartRef - The reference to the HelmChart object used as the source to this HelmRelease + HelmChartRef *ObjectReferenceDefinition `json:"helmChartRef,omitempty"` + // FailureCount - Total number of times that the HelmRelease failed to install or upgrade + FailureCount *int64 `json:"failureCount,omitempty"` + // InstallFailureCount - Number of times that the HelmRelease failed to install + InstallFailureCount *int64 `json:"installFailureCount,omitempty"` + // UpgradeFailureCount - Number of times that the HelmRelease failed to upgrade + UpgradeFailureCount *int64 `json:"upgradeFailureCount,omitempty"` +} + +// Identity identity for the resource. +type Identity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != "" { + objectMap["type"] = i.Type + } + return json.Marshal(objectMap) +} + +// KustomizationDefinition the Kustomization defining how to reconcile the artifact pulled by the source +// type on the cluster. +type KustomizationDefinition struct { + // Name - READ-ONLY; Name of the Kustomization, matching the key in the Kustomizations object map. + Name *string `json:"name,omitempty"` + // Path - The path in the source reference to reconcile on the cluster. + Path *string `json:"path,omitempty"` + // DependsOn - Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. + DependsOn *[]string `json:"dependsOn,omitempty"` + // TimeoutInSeconds - The maximum time to attempt to reconcile the Kustomization on the cluster. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + // SyncIntervalInSeconds - The interval at which to re-reconcile the Kustomization on the cluster. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + // RetryIntervalInSeconds - The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. + RetryIntervalInSeconds *int64 `json:"retryIntervalInSeconds,omitempty"` + // Prune - Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + Prune *bool `json:"prune,omitempty"` + // Force - Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. + Force *bool `json:"force,omitempty"` +} + +// MarshalJSON is the custom marshaler for KustomizationDefinition. +func (kd KustomizationDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kd.Path != nil { + objectMap["path"] = kd.Path + } + if kd.DependsOn != nil { + objectMap["dependsOn"] = kd.DependsOn + } + if kd.TimeoutInSeconds != nil { + objectMap["timeoutInSeconds"] = kd.TimeoutInSeconds + } + if kd.SyncIntervalInSeconds != nil { + objectMap["syncIntervalInSeconds"] = kd.SyncIntervalInSeconds + } + if kd.RetryIntervalInSeconds != nil { + objectMap["retryIntervalInSeconds"] = kd.RetryIntervalInSeconds + } + if kd.Prune != nil { + objectMap["prune"] = kd.Prune + } + if kd.Force != nil { + objectMap["force"] = kd.Force + } + return json.Marshal(objectMap) +} + +// KustomizationPatchDefinition the Kustomization defining how to reconcile the artifact pulled by the +// source type on the cluster. +type KustomizationPatchDefinition struct { + // Path - The path in the source reference to reconcile on the cluster. + Path *string `json:"path,omitempty"` + // DependsOn - Specifies other Kustomizations that this Kustomization depends on. This Kustomization will not reconcile until all dependencies have completed their reconciliation. + DependsOn *[]string `json:"dependsOn,omitempty"` + // TimeoutInSeconds - The maximum time to attempt to reconcile the Kustomization on the cluster. + TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` + // SyncIntervalInSeconds - The interval at which to re-reconcile the Kustomization on the cluster. + SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` + // RetryIntervalInSeconds - The interval at which to re-reconcile the Kustomization on the cluster in the event of failure on reconciliation. + RetryIntervalInSeconds *int64 `json:"retryIntervalInSeconds,omitempty"` + // Prune - Enable/disable garbage collections of Kubernetes objects created by this Kustomization. + Prune *bool `json:"prune,omitempty"` + // Force - Enable/disable re-creating Kubernetes resources on the cluster when patching fails due to an immutable field change. + Force *bool `json:"force,omitempty"` +} + +// ObjectReferenceDefinition object reference to a Kubernetes object on a cluster +type ObjectReferenceDefinition struct { + // Name - Name of the object + Name *string `json:"name,omitempty"` + // Namespace - Namespace of the object + Namespace *string `json:"namespace,omitempty"` +} + +// ObjectStatusConditionDefinition status condition of Kubernetes object +type ObjectStatusConditionDefinition struct { + // LastTransitionTime - Last time this status condition has changed + LastTransitionTime *date.Time `json:"lastTransitionTime,omitempty"` + // Message - A more verbose description of the object status condition + Message *string `json:"message,omitempty"` + // Reason - Reason for the specified status condition type status + Reason *string `json:"reason,omitempty"` + // Status - Status of the Kubernetes object condition type + Status *string `json:"status,omitempty"` + // Type - Object status condition type for this object + Type *string `json:"type,omitempty"` +} + +// ObjectStatusDefinition statuses of objects deployed by the user-specified kustomizations from the git +// repository. +type ObjectStatusDefinition struct { + // Name - Name of the applied object + Name *string `json:"name,omitempty"` + // Namespace - Namespace of the applied object + Namespace *string `json:"namespace,omitempty"` + // Kind - Kind of the applied object + Kind *string `json:"kind,omitempty"` + // ComplianceState - Compliance state of the applied object showing whether the applied object has come into a ready state on the cluster. Possible values include: 'FluxComplianceStateCompliant', 'FluxComplianceStateNonCompliant', 'FluxComplianceStatePending', 'FluxComplianceStateSuspended', 'FluxComplianceStateUnknown' + ComplianceState FluxComplianceState `json:"complianceState,omitempty"` + // AppliedBy - Object reference to the Kustomization that applied this object + AppliedBy *ObjectReferenceDefinition `json:"appliedBy,omitempty"` + // StatusConditions - List of Kubernetes object status conditions present on the cluster + StatusConditions *[]ObjectStatusConditionDefinition `json:"statusConditions,omitempty"` + // HelmReleaseProperties - Additional properties that are provided from objects of the HelmRelease kind + HelmReleaseProperties *HelmReleasePropertiesDefinition `json:"helmReleaseProperties,omitempty"` +} + +// OperationStatusList the async operations in progress, in the cluster. +type OperationStatusList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of async operations in progress, in the cluster. + Value *[]OperationStatusResult `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of Operation Result objects, if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusList. +func (osl OperationStatusList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationStatusListIterator provides access to a complete listing of OperationStatusResult values. +type OperationStatusListIterator struct { + i int + page OperationStatusListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationStatusListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationStatusListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationStatusListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationStatusListIterator) Response() OperationStatusList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationStatusListIterator) Value() OperationStatusResult { + if !iter.page.NotDone() { + return OperationStatusResult{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationStatusListIterator type. +func NewOperationStatusListIterator(page OperationStatusListPage) OperationStatusListIterator { + return OperationStatusListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (osl OperationStatusList) IsEmpty() bool { + return osl.Value == nil || len(*osl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (osl OperationStatusList) hasNextLink() bool { + return osl.NextLink != nil && len(*osl.NextLink) != 0 +} + +// operationStatusListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (osl OperationStatusList) operationStatusListPreparer(ctx context.Context) (*http.Request, error) { + if !osl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(osl.NextLink))) +} + +// OperationStatusListPage contains a page of OperationStatusResult values. +type OperationStatusListPage struct { + fn func(context.Context, OperationStatusList) (OperationStatusList, error) + osl OperationStatusList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationStatusListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.osl) + if err != nil { + return err + } + page.osl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationStatusListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationStatusListPage) NotDone() bool { + return !page.osl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationStatusListPage) Response() OperationStatusList { + return page.osl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationStatusListPage) Values() []OperationStatusResult { + if page.osl.IsEmpty() { + return nil + } + return *page.osl.Value +} + +// Creates a new instance of the OperationStatusListPage type. +func NewOperationStatusListPage(cur OperationStatusList, getNextPage func(context.Context, OperationStatusList) (OperationStatusList, error)) OperationStatusListPage { + return OperationStatusListPage{ + fn: getNextPage, + osl: cur, + } +} + +// OperationStatusResult the current status of an async operation. +type OperationStatusResult struct { + autorest.Response `json:"-"` + // ID - Fully qualified ID for the async operation. + ID *string `json:"id,omitempty"` + // Name - Name of the async operation. + Name *string `json:"name,omitempty"` + // Status - Operation status. + Status *string `json:"status,omitempty"` + // Properties - Additional information, if available. + Properties map[string]*string `json:"properties"` + // Error - READ-ONLY; If present, details of the operation error. + Error *ErrorDetail `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationStatusResult. +func (osr OperationStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osr.ID != nil { + objectMap["id"] = osr.ID + } + if osr.Name != nil { + objectMap["name"] = osr.Name + } + if osr.Status != nil { + objectMap["status"] = osr.Status + } + if osr.Properties != nil { + objectMap["properties"] = osr.Properties + } + return json.Marshal(objectMap) +} + +// PatchExtension the Extension Patch Request object. +type PatchExtension struct { + // PatchExtensionProperties - Updatable properties of an Extension Patch Request + *PatchExtensionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PatchExtension. +func (peVar PatchExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if peVar.PatchExtensionProperties != nil { + objectMap["properties"] = peVar.PatchExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PatchExtension struct. +func (peVar *PatchExtension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var patchExtensionProperties PatchExtensionProperties + err = json.Unmarshal(*v, &patchExtensionProperties) + if err != nil { + return err + } + peVar.PatchExtensionProperties = &patchExtensionProperties + } + } + } + + return nil +} + +// PatchExtensionProperties updatable properties of an Extension Patch Request +type PatchExtensionProperties struct { + // AutoUpgradeMinorVersion - Flag to note if this extension participates in auto upgrade of minor version, or not. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // ReleaseTrain - ReleaseTrain this extension participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + ReleaseTrain *string `json:"releaseTrain,omitempty"` + // Version - Version of the extension for this extension, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. + Version *string `json:"version,omitempty"` + // ConfigurationSettings - Configuration settings, as name-value pairs for configuring this extension. + ConfigurationSettings map[string]*string `json:"configurationSettings"` + // ConfigurationProtectedSettings - Configuration settings that are sensitive, as name-value pairs for configuring this extension. + ConfigurationProtectedSettings map[string]*string `json:"configurationProtectedSettings"` +} + +// MarshalJSON is the custom marshaler for PatchExtensionProperties. +func (peVar PatchExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if peVar.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = peVar.AutoUpgradeMinorVersion + } + if peVar.ReleaseTrain != nil { + objectMap["releaseTrain"] = peVar.ReleaseTrain + } + if peVar.Version != nil { + objectMap["version"] = peVar.Version + } + if peVar.ConfigurationSettings != nil { + objectMap["configurationSettings"] = peVar.ConfigurationSettings + } + if peVar.ConfigurationProtectedSettings != nil { + objectMap["configurationProtectedSettings"] = peVar.ConfigurationProtectedSettings + } + return json.Marshal(objectMap) +} + +// Plan plan for the resource. +type Plan struct { + // Name - A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + // Publisher - The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + // Product - The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + // PromotionCode - A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + // Version - The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RepositoryRefDefinition the source reference for the GitRepository object. +type RepositoryRefDefinition struct { + // Branch - The git repository branch name to checkout. + Branch *string `json:"branch,omitempty"` + // Tag - The git repository tag name to checkout. This takes precedence over branch. + Tag *string `json:"tag,omitempty"` + // Semver - The semver range used to match against git repository tags. This takes precedence over tag. + Semver *string `json:"semver,omitempty"` + // Commit - The commit SHA to checkout. This value must be combined with the branch name to be valid. This takes precedence over semver. + Commit *string `json:"commit,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceModelWithAllowedPropertySet the resource model definition containing the full set of allowed +// properties for a resource. Except properties bag, there cannot be a top level property outside of this +// set. +type ResourceModelWithAllowedPropertySet struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ManagedBy - The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + ManagedBy *string `json:"managedBy,omitempty"` + // Kind - Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + Kind *string `json:"kind,omitempty"` + // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + Identity *ResourceModelWithAllowedPropertySetIdentity `json:"identity,omitempty"` + Sku *ResourceModelWithAllowedPropertySetSku `json:"sku,omitempty"` + Plan *ResourceModelWithAllowedPropertySetPlan `json:"plan,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceModelWithAllowedPropertySet. +func (rmwaps ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmwaps.Location != nil { + objectMap["location"] = rmwaps.Location + } + if rmwaps.ManagedBy != nil { + objectMap["managedBy"] = rmwaps.ManagedBy + } + if rmwaps.Kind != nil { + objectMap["kind"] = rmwaps.Kind + } + if rmwaps.Tags != nil { + objectMap["tags"] = rmwaps.Tags + } + if rmwaps.Identity != nil { + objectMap["identity"] = rmwaps.Identity + } + if rmwaps.Sku != nil { + objectMap["sku"] = rmwaps.Sku + } + if rmwaps.Plan != nil { + objectMap["plan"] = rmwaps.Plan + } + return json.Marshal(objectMap) +} + +// ResourceModelWithAllowedPropertySetIdentity ... +type ResourceModelWithAllowedPropertySetIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceModelWithAllowedPropertySetIdentity. +func (rmwaps ResourceModelWithAllowedPropertySetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmwaps.Type != "" { + objectMap["type"] = rmwaps.Type + } + return json.Marshal(objectMap) +} + +// ResourceModelWithAllowedPropertySetPlan ... +type ResourceModelWithAllowedPropertySetPlan struct { + // Name - A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + // Publisher - The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + // Product - The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + // PromotionCode - A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + // Version - The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + +// ResourceModelWithAllowedPropertySetSku ... +type ResourceModelWithAllowedPropertySetSku struct { + // Name - The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string `json:"name,omitempty"` + // Tier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'SkuTierFree', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` + // Size - The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + // Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + Capacity *int32 `json:"capacity,omitempty"` +} + +// ResourceProviderOperation supported operation of this resource provider. +type ResourceProviderOperation struct { + // Name - Operation name, in format of {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *ResourceProviderOperationDisplay `json:"display,omitempty"` + // IsDataAction - READ-ONLY; The flag that indicates whether the operation applies to data plane. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Origin - READ-ONLY; Origin of the operation + Origin *string `json:"origin,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceProviderOperation. +func (rpo ResourceProviderOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpo.Name != nil { + objectMap["name"] = rpo.Name + } + if rpo.Display != nil { + objectMap["display"] = rpo.Display + } + return json.Marshal(objectMap) +} + +// ResourceProviderOperationDisplay display metadata associated with the operation. +type ResourceProviderOperationDisplay struct { + // Provider - Resource provider: Microsoft KubernetesConfiguration. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Description of this operation. + Description *string `json:"description,omitempty"` +} + +// ResourceProviderOperationList result of the request to list operations. +type ResourceProviderOperationList struct { + autorest.Response `json:"-"` + // Value - List of operations supported by this resource provider. + Value *[]ResourceProviderOperation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to the next set of results, if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceProviderOperationList. +func (rpol ResourceProviderOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpol.Value != nil { + objectMap["value"] = rpol.Value + } + return json.Marshal(objectMap) +} + +// ResourceProviderOperationListIterator provides access to a complete listing of ResourceProviderOperation +// values. +type ResourceProviderOperationListIterator struct { + i int + page ResourceProviderOperationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceProviderOperationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceProviderOperationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceProviderOperationListIterator) Response() ResourceProviderOperationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceProviderOperationListIterator) Value() ResourceProviderOperation { + if !iter.page.NotDone() { + return ResourceProviderOperation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceProviderOperationListIterator type. +func NewResourceProviderOperationListIterator(page ResourceProviderOperationListPage) ResourceProviderOperationListIterator { + return ResourceProviderOperationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpol ResourceProviderOperationList) IsEmpty() bool { + return rpol.Value == nil || len(*rpol.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpol ResourceProviderOperationList) hasNextLink() bool { + return rpol.NextLink != nil && len(*rpol.NextLink) != 0 +} + +// resourceProviderOperationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpol ResourceProviderOperationList) resourceProviderOperationListPreparer(ctx context.Context) (*http.Request, error) { + if !rpol.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpol.NextLink))) +} + +// ResourceProviderOperationListPage contains a page of ResourceProviderOperation values. +type ResourceProviderOperationListPage struct { + fn func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error) + rpol ResourceProviderOperationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceProviderOperationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpol) + if err != nil { + return err + } + page.rpol = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceProviderOperationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceProviderOperationListPage) NotDone() bool { + return !page.rpol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceProviderOperationListPage) Response() ResourceProviderOperationList { + return page.rpol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceProviderOperationListPage) Values() []ResourceProviderOperation { + if page.rpol.IsEmpty() { + return nil + } + return *page.rpol.Value +} + +// Creates a new instance of the ResourceProviderOperationListPage type. +func NewResourceProviderOperationListPage(cur ResourceProviderOperationList, getNextPage func(context.Context, ResourceProviderOperationList) (ResourceProviderOperationList, error)) ResourceProviderOperationListPage { + return ResourceProviderOperationListPage{ + fn: getNextPage, + rpol: cur, + } +} + +// Scope scope of the extension. It can be either Cluster or Namespace; but not both. +type Scope struct { + // Cluster - Specifies that the scope of the extension is Cluster + Cluster *ScopeCluster `json:"cluster,omitempty"` + // Namespace - Specifies that the scope of the extension is Namespace + Namespace *ScopeNamespace `json:"namespace,omitempty"` +} + +// ScopeCluster specifies that the scope of the extension is Cluster +type ScopeCluster struct { + // ReleaseNamespace - Namespace where the extension Release must be placed, for a Cluster scoped extension. If this namespace does not exist, it will be created + ReleaseNamespace *string `json:"releaseNamespace,omitempty"` +} + +// ScopeNamespace specifies that the scope of the extension is Namespace +type ScopeNamespace struct { + // TargetNamespace - Namespace where the extension will be created for an Namespace scoped extension. If this namespace does not exist, it will be created + TargetNamespace *string `json:"targetNamespace,omitempty"` +} + +// Sku the resource model definition representing SKU +type Sku struct { + // Name - The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string `json:"name,omitempty"` + // Tier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'SkuTierFree', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` + // Size - The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + // Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + Capacity *int32 `json:"capacity,omitempty"` +} + +// SourceControlConfiguration the SourceControl Configuration object returned in Get & Put response. +type SourceControlConfiguration struct { + autorest.Response `json:"-"` + // SourceControlConfigurationProperties - Properties to create a Source Control Configuration resource + *SourceControlConfigurationProperties `json:"properties,omitempty"` + // SystemData - Top level metadata https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlConfiguration. +func (scc SourceControlConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scc.SourceControlConfigurationProperties != nil { + objectMap["properties"] = scc.SourceControlConfigurationProperties + } + if scc.SystemData != nil { + objectMap["systemData"] = scc.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlConfiguration struct. +func (scc *SourceControlConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlConfigurationProperties SourceControlConfigurationProperties + err = json.Unmarshal(*v, &sourceControlConfigurationProperties) + if err != nil { + return err + } + scc.SourceControlConfigurationProperties = &sourceControlConfigurationProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + scc.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scc.Type = &typeVar + } + } + } + + return nil +} + +// SourceControlConfigurationList result of the request to list Source Control Configurations. It contains +// a list of SourceControlConfiguration objects and a URL link to get the next set of results. +type SourceControlConfigurationList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Source Control Configurations within a Kubernetes cluster. + Value *[]SourceControlConfiguration `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of configuration objects, if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlConfigurationList. +func (sccl SourceControlConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SourceControlConfigurationListIterator provides access to a complete listing of +// SourceControlConfiguration values. +type SourceControlConfigurationListIterator struct { + i int + page SourceControlConfigurationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlConfigurationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SourceControlConfigurationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlConfigurationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlConfigurationListIterator) Response() SourceControlConfigurationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlConfigurationListIterator) Value() SourceControlConfiguration { + if !iter.page.NotDone() { + return SourceControlConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceControlConfigurationListIterator type. +func NewSourceControlConfigurationListIterator(page SourceControlConfigurationListPage) SourceControlConfigurationListIterator { + return SourceControlConfigurationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sccl SourceControlConfigurationList) IsEmpty() bool { + return sccl.Value == nil || len(*sccl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sccl SourceControlConfigurationList) hasNextLink() bool { + return sccl.NextLink != nil && len(*sccl.NextLink) != 0 +} + +// sourceControlConfigurationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sccl SourceControlConfigurationList) sourceControlConfigurationListPreparer(ctx context.Context) (*http.Request, error) { + if !sccl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sccl.NextLink))) +} + +// SourceControlConfigurationListPage contains a page of SourceControlConfiguration values. +type SourceControlConfigurationListPage struct { + fn func(context.Context, SourceControlConfigurationList) (SourceControlConfigurationList, error) + sccl SourceControlConfigurationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlConfigurationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sccl) + if err != nil { + return err + } + page.sccl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SourceControlConfigurationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlConfigurationListPage) NotDone() bool { + return !page.sccl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlConfigurationListPage) Response() SourceControlConfigurationList { + return page.sccl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlConfigurationListPage) Values() []SourceControlConfiguration { + if page.sccl.IsEmpty() { + return nil + } + return *page.sccl.Value +} + +// Creates a new instance of the SourceControlConfigurationListPage type. +func NewSourceControlConfigurationListPage(cur SourceControlConfigurationList, getNextPage func(context.Context, SourceControlConfigurationList) (SourceControlConfigurationList, error)) SourceControlConfigurationListPage { + return SourceControlConfigurationListPage{ + fn: getNextPage, + sccl: cur, + } +} + +// SourceControlConfigurationProperties properties to create a Source Control Configuration resource +type SourceControlConfigurationProperties struct { + // RepositoryURL - Url of the SourceControl Repository. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // OperatorNamespace - The namespace to which this operator is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only. + OperatorNamespace *string `json:"operatorNamespace,omitempty"` + // OperatorInstanceName - Instance name of the operator - identifying the specific configuration. + OperatorInstanceName *string `json:"operatorInstanceName,omitempty"` + // OperatorType - Type of the operator. Possible values include: 'OperatorTypeFlux' + OperatorType OperatorType `json:"operatorType,omitempty"` + // OperatorParams - Any Parameters for the Operator instance in string format. + OperatorParams *string `json:"operatorParams,omitempty"` + // ConfigurationProtectedSettings - Name-value pairs of protected configuration settings for the configuration + ConfigurationProtectedSettings map[string]*string `json:"configurationProtectedSettings"` + // OperatorScope - Scope at which the operator will be installed. Possible values include: 'OperatorScopeTypeCluster', 'OperatorScopeTypeNamespace' + OperatorScope OperatorScopeType `json:"operatorScope,omitempty"` + // RepositoryPublicKey - READ-ONLY; Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user). + RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` + // SSHKnownHostsContents - Base64-encoded known_hosts contents containing public SSH keys required to access private Git instances + SSHKnownHostsContents *string `json:"sshKnownHostsContents,omitempty"` + // EnableHelmOperator - Option to enable Helm Operator for this git configuration. + EnableHelmOperator *bool `json:"enableHelmOperator,omitempty"` + // HelmOperatorProperties - Properties for Helm operator. + HelmOperatorProperties *HelmOperatorProperties `json:"helmOperatorProperties,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource provider. Possible values include: 'ProvisioningStateTypeAccepted', 'ProvisioningStateTypeDeleting', 'ProvisioningStateTypeRunning', 'ProvisioningStateTypeSucceeded', 'ProvisioningStateTypeFailed' + ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` + // ComplianceStatus - READ-ONLY; Compliance Status of the Configuration + ComplianceStatus *ComplianceStatus `json:"complianceStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlConfigurationProperties. +func (scc SourceControlConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scc.RepositoryURL != nil { + objectMap["repositoryUrl"] = scc.RepositoryURL + } + if scc.OperatorNamespace != nil { + objectMap["operatorNamespace"] = scc.OperatorNamespace + } + if scc.OperatorInstanceName != nil { + objectMap["operatorInstanceName"] = scc.OperatorInstanceName + } + if scc.OperatorType != "" { + objectMap["operatorType"] = scc.OperatorType + } + if scc.OperatorParams != nil { + objectMap["operatorParams"] = scc.OperatorParams + } + if scc.ConfigurationProtectedSettings != nil { + objectMap["configurationProtectedSettings"] = scc.ConfigurationProtectedSettings + } + if scc.OperatorScope != "" { + objectMap["operatorScope"] = scc.OperatorScope + } + if scc.SSHKnownHostsContents != nil { + objectMap["sshKnownHostsContents"] = scc.SSHKnownHostsContents + } + if scc.EnableHelmOperator != nil { + objectMap["enableHelmOperator"] = scc.EnableHelmOperator + } + if scc.HelmOperatorProperties != nil { + objectMap["helmOperatorProperties"] = scc.HelmOperatorProperties + } + return json.Marshal(objectMap) +} + +// SourceControlConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SourceControlConfigurationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SourceControlConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SourceControlConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SourceControlConfigurationsDeleteFuture.Result. +func (future *SourceControlConfigurationsDeleteFuture) result(client SourceControlConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kubernetesconfiguration.SourceControlConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operations.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operations.go new file mode 100644 index 000000000000..ac59972dfe00 --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operations.go @@ -0,0 +1,140 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the kubernetesConfiguration Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list all the available operations the KubernetesConfiguration resource provider supports. +func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.rpol.Response.Response != nil { + sc = result.rpol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.rpol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.rpol.hasNextLink() && result.rpol.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.KubernetesConfiguration/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result ResourceProviderOperationList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults ResourceProviderOperationList) (result ResourceProviderOperationList, err error) { + req, err := lastResults.resourceProviderOperationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result ResourceProviderOperationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operationstatus.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operationstatus.go new file mode 100644 index 000000000000..741c198e9bdb --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/operationstatus.go @@ -0,0 +1,260 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationStatusClient is the kubernetesConfiguration Client +type OperationStatusClient struct { + BaseClient +} + +// NewOperationStatusClient creates an instance of the OperationStatusClient client. +func NewOperationStatusClient(subscriptionID string) OperationStatusClient { + return NewOperationStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationStatusClientWithBaseURI creates an instance of the OperationStatusClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationStatusClientWithBaseURI(baseURI string, subscriptionID string) OperationStatusClient { + return OperationStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get Async Operation status +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// extensionName - name of the Extension. +// operationID - operation Id +func (client OperationStatusClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, operationID string) (result OperationStatusResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.OperationStatusClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionName, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationStatusClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, extensionName string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "extensionName": autorest.Encode("path", extensionName), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionName}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationStatusClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationStatusClient) GetResponder(resp *http.Response) (result OperationStatusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list Async Operations, currently in progress, in a cluster +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +func (client OperationStatusClient) List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result OperationStatusListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusClient.List") + defer func() { + sc := -1 + if result.osl.Response.Response != nil { + sc = result.osl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.OperationStatusClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.osl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "List", resp, "Failure sending request") + return + } + + result.osl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "List", resp, "Failure responding to request") + return + } + if result.osl.hasNextLink() && result.osl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationStatusClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationStatusClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationStatusClient) ListResponder(resp *http.Response) (result OperationStatusList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationStatusClient) listNextResults(ctx context.Context, lastResults OperationStatusList) (result OperationStatusList, err error) { + req, err := lastResults.operationStatusListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationStatusClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationStatusClient) ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result OperationStatusListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + return +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/sourcecontrolconfigurations.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/sourcecontrolconfigurations.go new file mode 100644 index 000000000000..dda699cd7c3b --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/sourcecontrolconfigurations.go @@ -0,0 +1,451 @@ +package kubernetesconfiguration + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SourceControlConfigurationsClient is the kubernetesConfiguration Client +type SourceControlConfigurationsClient struct { + BaseClient +} + +// NewSourceControlConfigurationsClient creates an instance of the SourceControlConfigurationsClient client. +func NewSourceControlConfigurationsClient(subscriptionID string) SourceControlConfigurationsClient { + return NewSourceControlConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlConfigurationsClientWithBaseURI creates an instance of the SourceControlConfigurationsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSourceControlConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlConfigurationsClient { + return SourceControlConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a new Kubernetes Source Control Configuration. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// sourceControlConfigurationName - name of the Source Control Configuration. +// sourceControlConfiguration - properties necessary to Create KubernetesConfiguration. +func (client SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration SourceControlConfiguration) (result SourceControlConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.SourceControlConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SourceControlConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration SourceControlConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlConfigurationName": autorest.Encode("path", sourceControlConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", pathParameters), + autorest.WithJSON(sourceControlConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SourceControlConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result SourceControlConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete this will delete the YAML file used to set up the Source control configuration, thus stopping future sync +// from the source repo. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// sourceControlConfigurationName - name of the Source Control Configuration. +func (client SourceControlConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result SourceControlConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.SourceControlConfigurationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SourceControlConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlConfigurationName": autorest.Encode("path", sourceControlConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlConfigurationsClient) DeleteSender(req *http.Request) (future SourceControlConfigurationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SourceControlConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets details of the Source Control Configuration. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +// sourceControlConfigurationName - name of the Source Control Configuration. +func (client SourceControlConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result SourceControlConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.SourceControlConfigurationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlConfigurationName": autorest.Encode("path", sourceControlConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlConfigurationsClient) GetResponder(resp *http.Response) (result SourceControlConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all Source Control Configurations. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterRp - the Kubernetes cluster RP - i.e. Microsoft.ContainerService, Microsoft.Kubernetes, +// Microsoft.HybridContainerService. +// clusterResourceName - the Kubernetes cluster resource name - i.e. managedClusters, connectedClusters, +// provisionedClusters. +// clusterName - the name of the kubernetes cluster. +func (client SourceControlConfigurationsClient) List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result SourceControlConfigurationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.List") + defer func() { + sc := -1 + if result.sccl.Response.Response != nil { + sc = result.sccl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("kubernetesconfiguration.SourceControlConfigurationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sccl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result.sccl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.sccl.hasNextLink() && result.sccl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SourceControlConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "clusterResourceName": autorest.Encode("path", clusterResourceName), + "clusterRp": autorest.Encode("path", clusterRp), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SourceControlConfigurationsClient) ListResponder(resp *http.Response) (result SourceControlConfigurationList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SourceControlConfigurationsClient) listNextResults(ctx context.Context, lastResults SourceControlConfigurationList) (result SourceControlConfigurationList, err error) { + req, err := lastResults.sourceControlConfigurationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result SourceControlConfigurationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) + return +} diff --git a/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/version.go b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/version.go new file mode 100644 index 000000000000..9fa7eb6d4199 --- /dev/null +++ b/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration/version.go @@ -0,0 +1,19 @@ +package kubernetesconfiguration + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " kubernetesconfiguration/2022-03-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} From a214e296e3fd5283653065b8462dd26c3f4efcdd Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 14:02:10 +0800 Subject: [PATCH 6/8] Generated from specification/streamanalytics/resource-manager/readme.md tag package-pure-2020-03 (commit hash: 61218420e95ad3435a029144877b110b56418958) --- .../mgmt/streamanalytics/models.go | 4 +- .../mgmt/streamanalytics/models.go | 4 +- .../2020-03-01/streamanalytics/CHANGELOG.md | 65 ++--- .../2020-03-01/streamanalytics/_meta.json | 2 +- .../mgmt/2020-03-01/streamanalytics/enums.go | 4 +- .../mgmt/2020-03-01/streamanalytics/models.go | 275 +++++++++++++----- 6 files changed, 249 insertions(+), 105 deletions(-) diff --git a/profiles/latest/streamanalytics/mgmt/streamanalytics/models.go b/profiles/latest/streamanalytics/mgmt/streamanalytics/models.go index 2416e271486d..e6a9cc7a4c55 100644 --- a/profiles/latest/streamanalytics/mgmt/streamanalytics/models.go +++ b/profiles/latest/streamanalytics/mgmt/streamanalytics/models.go @@ -173,6 +173,7 @@ const ( type TypeBasicFunctionProperties = original.TypeBasicFunctionProperties const ( + TypeBasicFunctionPropertiesTypeAggregate TypeBasicFunctionProperties = original.TypeBasicFunctionPropertiesTypeAggregate TypeBasicFunctionPropertiesTypeFunctionProperties TypeBasicFunctionProperties = original.TypeBasicFunctionPropertiesTypeFunctionProperties TypeBasicFunctionPropertiesTypeScalar TypeBasicFunctionProperties = original.TypeBasicFunctionPropertiesTypeScalar ) @@ -227,6 +228,7 @@ const ( UdfTypeScalar UdfType = original.UdfTypeScalar ) +type AggregateFunctionProperties = original.AggregateFunctionProperties type AvroSerialization = original.AvroSerialization type AzureDataLakeStoreOutputDataSource = original.AzureDataLakeStoreOutputDataSource type AzureDataLakeStoreOutputDataSourceProperties = original.AzureDataLakeStoreOutputDataSourceProperties @@ -300,6 +302,7 @@ type EventHubV2OutputDataSource = original.EventHubV2OutputDataSource type EventHubV2StreamInputDataSource = original.EventHubV2StreamInputDataSource type Function = original.Function type FunctionBinding = original.FunctionBinding +type FunctionConfiguration = original.FunctionConfiguration type FunctionInput = original.FunctionInput type FunctionListResult = original.FunctionListResult type FunctionListResultIterator = original.FunctionListResultIterator @@ -359,7 +362,6 @@ type ReferenceInputDataSource = original.ReferenceInputDataSource type ReferenceInputProperties = original.ReferenceInputProperties type Resource = original.Resource type ResourceTestStatus = original.ResourceTestStatus -type ScalarFunctionConfiguration = original.ScalarFunctionConfiguration type ScalarFunctionProperties = original.ScalarFunctionProperties type ScaleStreamingJobParameters = original.ScaleStreamingJobParameters type Serialization = original.Serialization diff --git a/profiles/preview/streamanalytics/mgmt/streamanalytics/models.go b/profiles/preview/streamanalytics/mgmt/streamanalytics/models.go index 90d515276060..81d19ced12cd 100644 --- a/profiles/preview/streamanalytics/mgmt/streamanalytics/models.go +++ b/profiles/preview/streamanalytics/mgmt/streamanalytics/models.go @@ -173,6 +173,7 @@ const ( type TypeBasicFunctionProperties = original.TypeBasicFunctionProperties const ( + TypeBasicFunctionPropertiesTypeAggregate TypeBasicFunctionProperties = original.TypeBasicFunctionPropertiesTypeAggregate TypeBasicFunctionPropertiesTypeFunctionProperties TypeBasicFunctionProperties = original.TypeBasicFunctionPropertiesTypeFunctionProperties TypeBasicFunctionPropertiesTypeScalar TypeBasicFunctionProperties = original.TypeBasicFunctionPropertiesTypeScalar ) @@ -227,6 +228,7 @@ const ( UdfTypeScalar UdfType = original.UdfTypeScalar ) +type AggregateFunctionProperties = original.AggregateFunctionProperties type AvroSerialization = original.AvroSerialization type AzureDataLakeStoreOutputDataSource = original.AzureDataLakeStoreOutputDataSource type AzureDataLakeStoreOutputDataSourceProperties = original.AzureDataLakeStoreOutputDataSourceProperties @@ -300,6 +302,7 @@ type EventHubV2OutputDataSource = original.EventHubV2OutputDataSource type EventHubV2StreamInputDataSource = original.EventHubV2StreamInputDataSource type Function = original.Function type FunctionBinding = original.FunctionBinding +type FunctionConfiguration = original.FunctionConfiguration type FunctionInput = original.FunctionInput type FunctionListResult = original.FunctionListResult type FunctionListResultIterator = original.FunctionListResultIterator @@ -359,7 +362,6 @@ type ReferenceInputDataSource = original.ReferenceInputDataSource type ReferenceInputProperties = original.ReferenceInputProperties type Resource = original.Resource type ResourceTestStatus = original.ResourceTestStatus -type ScalarFunctionConfiguration = original.ScalarFunctionConfiguration type ScalarFunctionProperties = original.ScalarFunctionProperties type ScaleStreamingJobParameters = original.ScaleStreamingJobParameters type Serialization = original.Serialization diff --git a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md index 4957b7129df9..1f2276184be6 100644 --- a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md +++ b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md @@ -1,51 +1,48 @@ # Change History +## Breaking Changes + +### Removed Funcs + +1. *ScalarFunctionConfiguration.UnmarshalJSON([]byte) error + +### Struct Changes + +#### Removed Structs + +1. ScalarFunctionConfiguration + +#### Removed Struct Fields + +1. ScalarFunctionProperties.*ScalarFunctionConfiguration + ## Additive Changes ### New Constants -1. TypeBasicOutputDataSource.TypeBasicOutputDataSourceTypeMicrosoftAzureFunction +1. TypeBasicFunctionProperties.TypeBasicFunctionPropertiesTypeAggregate ### New Funcs -1. *AzureFunctionOutputDataSource.UnmarshalJSON([]byte) error -1. AzureDataLakeStoreOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsAzureSynapseOutputDataSource() (*AzureSynapseOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsBasicOutputDataSource() (BasicOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsBlobOutputDataSource() (*BlobOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsEventHubV2OutputDataSource() (*EventHubV2OutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsOutputDataSource() (*OutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) -1. AzureFunctionOutputDataSource.AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) -1. AzureFunctionOutputDataSource.MarshalJSON() ([]byte, error) -1. AzureSQLDatabaseOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. AzureSynapseOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. AzureTableOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. BlobOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. DocumentDbOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. EventHubOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. EventHubV2OutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. OutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. PowerBIOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. ServiceBusQueueOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) -1. ServiceBusTopicOutputDataSource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) +1. *AggregateFunctionProperties.UnmarshalJSON([]byte) error +1. *FunctionConfiguration.UnmarshalJSON([]byte) error +1. *FunctionProperties.UnmarshalJSON([]byte) error +1. AggregateFunctionProperties.AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) +1. AggregateFunctionProperties.AsBasicFunctionProperties() (BasicFunctionProperties, bool) +1. AggregateFunctionProperties.AsFunctionProperties() (*FunctionProperties, bool) +1. AggregateFunctionProperties.AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) +1. AggregateFunctionProperties.MarshalJSON() ([]byte, error) +1. FunctionProperties.AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) +1. ScalarFunctionProperties.AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) ### Struct Changes #### New Structs -1. AzureFunctionOutputDataSource -1. AzureFunctionOutputDataSourceProperties +1. AggregateFunctionProperties +1. FunctionConfiguration #### New Struct Fields -1. BlobDataSourceProperties.AuthenticationMode -1. BlobReferenceInputDataSourceProperties.AuthenticationMode -1. BlobStreamInputDataSourceProperties.AuthenticationMode +1. FunctionProperties.*FunctionConfiguration +1. ScalarFunctionProperties.*FunctionConfiguration diff --git a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/_meta.json b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/_meta.json index e783cfa86ff7..8438509bd773 100644 --- a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/_meta.json +++ b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/_meta.json @@ -1,5 +1,5 @@ { - "commit": "162460648e39b3cd20ef3d302008add138e90223", + "commit": "61218420e95ad3435a029144877b110b56418958", "readme": "/_/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.md", "tag": "package-pure-2020-03", "use": "@microsoft.azure/autorest.go@2.1.187", diff --git a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/enums.go b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/enums.go index d0928f60a9d2..c160d225282a 100644 --- a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/enums.go +++ b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/enums.go @@ -331,6 +331,8 @@ func PossibleTypeBasicFunctionBindingValues() []TypeBasicFunctionBinding { type TypeBasicFunctionProperties string const ( + // TypeBasicFunctionPropertiesTypeAggregate ... + TypeBasicFunctionPropertiesTypeAggregate TypeBasicFunctionProperties = "Aggregate" // TypeBasicFunctionPropertiesTypeFunctionProperties ... TypeBasicFunctionPropertiesTypeFunctionProperties TypeBasicFunctionProperties = "FunctionProperties" // TypeBasicFunctionPropertiesTypeScalar ... @@ -339,7 +341,7 @@ const ( // PossibleTypeBasicFunctionPropertiesValues returns an array of possible values for the TypeBasicFunctionProperties const type. func PossibleTypeBasicFunctionPropertiesValues() []TypeBasicFunctionProperties { - return []TypeBasicFunctionProperties{TypeBasicFunctionPropertiesTypeFunctionProperties, TypeBasicFunctionPropertiesTypeScalar} + return []TypeBasicFunctionProperties{TypeBasicFunctionPropertiesTypeAggregate, TypeBasicFunctionPropertiesTypeFunctionProperties, TypeBasicFunctionPropertiesTypeScalar} } // TypeBasicInputProperties enumerates the values for type basic input properties. diff --git a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/models.go b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/models.go index d98046ed9050..cdd214b2a08e 100644 --- a/services/streamanalytics/mgmt/2020-03-01/streamanalytics/models.go +++ b/services/streamanalytics/mgmt/2020-03-01/streamanalytics/models.go @@ -20,6 +20,90 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics" +// AggregateFunctionProperties the properties that are associated with an aggregate function. +type AggregateFunctionProperties struct { + // Etag - READ-ONLY; The current entity tag for the function. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. + Etag *string `json:"etag,omitempty"` + *FunctionConfiguration `json:"properties,omitempty"` + // Type - Possible values include: 'TypeBasicFunctionPropertiesTypeFunctionProperties', 'TypeBasicFunctionPropertiesTypeAggregate', 'TypeBasicFunctionPropertiesTypeScalar' + Type TypeBasicFunctionProperties `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AggregateFunctionProperties. +func (afp AggregateFunctionProperties) MarshalJSON() ([]byte, error) { + afp.Type = TypeBasicFunctionPropertiesTypeAggregate + objectMap := make(map[string]interface{}) + if afp.FunctionConfiguration != nil { + objectMap["properties"] = afp.FunctionConfiguration + } + if afp.Type != "" { + objectMap["type"] = afp.Type + } + return json.Marshal(objectMap) +} + +// AsAggregateFunctionProperties is the BasicFunctionProperties implementation for AggregateFunctionProperties. +func (afp AggregateFunctionProperties) AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) { + return &afp, true +} + +// AsScalarFunctionProperties is the BasicFunctionProperties implementation for AggregateFunctionProperties. +func (afp AggregateFunctionProperties) AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) { + return nil, false +} + +// AsFunctionProperties is the BasicFunctionProperties implementation for AggregateFunctionProperties. +func (afp AggregateFunctionProperties) AsFunctionProperties() (*FunctionProperties, bool) { + return nil, false +} + +// AsBasicFunctionProperties is the BasicFunctionProperties implementation for AggregateFunctionProperties. +func (afp AggregateFunctionProperties) AsBasicFunctionProperties() (BasicFunctionProperties, bool) { + return &afp, true +} + +// UnmarshalJSON is the custom unmarshaler for AggregateFunctionProperties struct. +func (afp *AggregateFunctionProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + afp.Etag = &etag + } + case "properties": + if v != nil { + var functionConfiguration FunctionConfiguration + err = json.Unmarshal(*v, &functionConfiguration) + if err != nil { + return err + } + afp.FunctionConfiguration = &functionConfiguration + } + case "type": + if v != nil { + var typeVar TypeBasicFunctionProperties + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + afp.Type = typeVar + } + } + } + + return nil +} + // AvroSerialization describes how data from an input is serialized or how data is serialized when written // to an output in Avro format. type AvroSerialization struct { @@ -3038,6 +3122,54 @@ func (fb FunctionBinding) AsBasicFunctionBinding() (BasicFunctionBinding, bool) return &fb, true } +// FunctionConfiguration ... +type FunctionConfiguration struct { + Inputs *[]FunctionInput `json:"inputs,omitempty"` + Output *FunctionOutput `json:"output,omitempty"` + Binding BasicFunctionBinding `json:"binding,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for FunctionConfiguration struct. +func (fc *FunctionConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "inputs": + if v != nil { + var inputs []FunctionInput + err = json.Unmarshal(*v, &inputs) + if err != nil { + return err + } + fc.Inputs = &inputs + } + case "output": + if v != nil { + var output FunctionOutput + err = json.Unmarshal(*v, &output) + if err != nil { + return err + } + fc.Output = &output + } + case "binding": + if v != nil { + binding, err := unmarshalBasicFunctionBinding(*v) + if err != nil { + return err + } + fc.Binding = binding + } + } + } + + return nil +} + // FunctionInput describes one input parameter of a function. type FunctionInput struct { // DataType - The (Azure Stream Analytics supported) data type of the function input parameter. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx @@ -3219,6 +3351,7 @@ type FunctionOutput struct { // BasicFunctionProperties the properties that are associated with a function. type BasicFunctionProperties interface { + AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) AsFunctionProperties() (*FunctionProperties, bool) } @@ -3226,8 +3359,9 @@ type BasicFunctionProperties interface { // FunctionProperties the properties that are associated with a function. type FunctionProperties struct { // Etag - READ-ONLY; The current entity tag for the function. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. - Etag *string `json:"etag,omitempty"` - // Type - Possible values include: 'TypeBasicFunctionPropertiesTypeFunctionProperties', 'TypeBasicFunctionPropertiesTypeScalar' + Etag *string `json:"etag,omitempty"` + *FunctionConfiguration `json:"properties,omitempty"` + // Type - Possible values include: 'TypeBasicFunctionPropertiesTypeFunctionProperties', 'TypeBasicFunctionPropertiesTypeAggregate', 'TypeBasicFunctionPropertiesTypeScalar' Type TypeBasicFunctionProperties `json:"type,omitempty"` } @@ -3239,6 +3373,10 @@ func unmarshalBasicFunctionProperties(body []byte) (BasicFunctionProperties, err } switch m["type"] { + case string(TypeBasicFunctionPropertiesTypeAggregate): + var afp AggregateFunctionProperties + err := json.Unmarshal(body, &afp) + return afp, err case string(TypeBasicFunctionPropertiesTypeScalar): var sfp ScalarFunctionProperties err := json.Unmarshal(body, &sfp) @@ -3272,12 +3410,20 @@ func unmarshalBasicFunctionPropertiesArray(body []byte) ([]BasicFunctionProperti func (fp FunctionProperties) MarshalJSON() ([]byte, error) { fp.Type = TypeBasicFunctionPropertiesTypeFunctionProperties objectMap := make(map[string]interface{}) + if fp.FunctionConfiguration != nil { + objectMap["properties"] = fp.FunctionConfiguration + } if fp.Type != "" { objectMap["type"] = fp.Type } return json.Marshal(objectMap) } +// AsAggregateFunctionProperties is the BasicFunctionProperties implementation for FunctionProperties. +func (fp FunctionProperties) AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) { + return nil, false +} + // AsScalarFunctionProperties is the BasicFunctionProperties implementation for FunctionProperties. func (fp FunctionProperties) AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) { return nil, false @@ -3293,6 +3439,48 @@ func (fp FunctionProperties) AsBasicFunctionProperties() (BasicFunctionPropertie return &fp, true } +// UnmarshalJSON is the custom unmarshaler for FunctionProperties struct. +func (fp *FunctionProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + fp.Etag = &etag + } + case "properties": + if v != nil { + var functionConfiguration FunctionConfiguration + err = json.Unmarshal(*v, &functionConfiguration) + if err != nil { + return err + } + fp.FunctionConfiguration = &functionConfiguration + } + case "type": + if v != nil { + var typeVar TypeBasicFunctionProperties + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fp.Type = typeVar + } + } + } + + return nil +} + // BasicFunctionRetrieveDefaultDefinitionParameters parameters used to specify the type of function to retrieve the // default definition for. type BasicFunctionRetrieveDefaultDefinitionParameters interface { @@ -5874,64 +6062,12 @@ func (rts ResourceTestStatus) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ScalarFunctionConfiguration describes the configuration of the scalar function. -type ScalarFunctionConfiguration struct { - // Inputs - A list of inputs describing the parameters of the function. - Inputs *[]FunctionInput `json:"inputs,omitempty"` - // Output - The output of the function. - Output *FunctionOutput `json:"output,omitempty"` - // Binding - The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint. - Binding BasicFunctionBinding `json:"binding,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ScalarFunctionConfiguration struct. -func (sfc *ScalarFunctionConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "inputs": - if v != nil { - var inputs []FunctionInput - err = json.Unmarshal(*v, &inputs) - if err != nil { - return err - } - sfc.Inputs = &inputs - } - case "output": - if v != nil { - var output FunctionOutput - err = json.Unmarshal(*v, &output) - if err != nil { - return err - } - sfc.Output = &output - } - case "binding": - if v != nil { - binding, err := unmarshalBasicFunctionBinding(*v) - if err != nil { - return err - } - sfc.Binding = binding - } - } - } - - return nil -} - // ScalarFunctionProperties the properties that are associated with a scalar function. type ScalarFunctionProperties struct { - // ScalarFunctionConfiguration - Describes the configuration of the scalar function. - *ScalarFunctionConfiguration `json:"properties,omitempty"` // Etag - READ-ONLY; The current entity tag for the function. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. - Etag *string `json:"etag,omitempty"` - // Type - Possible values include: 'TypeBasicFunctionPropertiesTypeFunctionProperties', 'TypeBasicFunctionPropertiesTypeScalar' + Etag *string `json:"etag,omitempty"` + *FunctionConfiguration `json:"properties,omitempty"` + // Type - Possible values include: 'TypeBasicFunctionPropertiesTypeFunctionProperties', 'TypeBasicFunctionPropertiesTypeAggregate', 'TypeBasicFunctionPropertiesTypeScalar' Type TypeBasicFunctionProperties `json:"type,omitempty"` } @@ -5939,8 +6075,8 @@ type ScalarFunctionProperties struct { func (sfp ScalarFunctionProperties) MarshalJSON() ([]byte, error) { sfp.Type = TypeBasicFunctionPropertiesTypeScalar objectMap := make(map[string]interface{}) - if sfp.ScalarFunctionConfiguration != nil { - objectMap["properties"] = sfp.ScalarFunctionConfiguration + if sfp.FunctionConfiguration != nil { + objectMap["properties"] = sfp.FunctionConfiguration } if sfp.Type != "" { objectMap["type"] = sfp.Type @@ -5948,6 +6084,11 @@ func (sfp ScalarFunctionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsAggregateFunctionProperties is the BasicFunctionProperties implementation for ScalarFunctionProperties. +func (sfp ScalarFunctionProperties) AsAggregateFunctionProperties() (*AggregateFunctionProperties, bool) { + return nil, false +} + // AsScalarFunctionProperties is the BasicFunctionProperties implementation for ScalarFunctionProperties. func (sfp ScalarFunctionProperties) AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) { return &sfp, true @@ -5972,23 +6113,23 @@ func (sfp *ScalarFunctionProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "etag": if v != nil { - var scalarFunctionConfiguration ScalarFunctionConfiguration - err = json.Unmarshal(*v, &scalarFunctionConfiguration) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - sfp.ScalarFunctionConfiguration = &scalarFunctionConfiguration + sfp.Etag = &etag } - case "etag": + case "properties": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var functionConfiguration FunctionConfiguration + err = json.Unmarshal(*v, &functionConfiguration) if err != nil { return err } - sfp.Etag = &etag + sfp.FunctionConfiguration = &functionConfiguration } case "type": if v != nil { From 7c395a181bbbc826ecdfd6e2f2c77438c26cf937 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 14:02:37 +0800 Subject: [PATCH 7/8] v63.0.0 --- CHANGELOG.md | 23 ++++++++++++++++++++++- version/version.go | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f72cf686faef..f5c01d3941e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # CHANGELOG +## `v63.0.0` + +### New Packages + +- `github.com/Azure/azure-sdk-for-go/services/containerinstance/mgmt/2021-10-01/containerinstance` +- `github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-02-01/containerservice` +- `github.com/Azure/azure-sdk-for-go/services/hardwaresecuritymodules/mgmt/2021-11-30/hardwaresecuritymodules` +- `github.com/Azure/azure-sdk-for-go/services/kubernetesconfiguration/mgmt/2022-03-01/kubernetesconfiguration` + +### Updated Packages + +| Package Path | Changelog | +| :--- | :---: | +| `github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md) | + +### Breaking Changes + +| Package Path | Changelog | +| :--- | :---: | +| `github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md) | + ## `v62.3.0` ### New Packages @@ -15,7 +36,7 @@ | Package Path | Changelog | | :--- | :---: | -| `github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md) | +| `github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics` | [details](https://github.com/Azure/azure-sdk-for-go/blob/v62.3.0/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md) | ## `v62.2.0` diff --git a/version/version.go b/version/version.go index acfdf20b0f16..cd2f9d33572a 100644 --- a/version/version.go +++ b/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v62.3.0" +const Number = "v63.0.0" From e8639ea773f487353c9c8a7e96df866fae743991 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Fri, 25 Mar 2022 14:55:42 +0800 Subject: [PATCH 8/8] add remove network api-version changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5c01d3941e9..a2e660b63734 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,18 @@ | :--- | :---: | | `github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2020-03-01/streamanalytics` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/streamanalytics/mgmt/2020-03-01/streamanalytics/CHANGELOG.md) | +### Removed Packages + +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-03-30/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-06-01/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-09-01/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-12-01/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-03-01/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-06-01/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-08-01/network` +- `github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network` +- `github.com/Azure/azure-sdk-for-go/services/preview/network/mgmt/2015-05-01-preview/network=` + ## `v62.3.0` ### New Packages